Unable to open designer form - c#

I recently had problems opening my Designer View of a form hat acts as launcher for all the other forms.
The solutions I found according to that suggest to delete the .RESX files which helped for some days now (always had to delete RESX before debuging the program) today, after trying to debug another time I got stuck with this screen:
This seems to be caused by me deleting the resx files.
I can not find anything according to this online.
I tried to rebuild the project, getting the deleted file(s) back from the paperbin but nothing seems to help right here and I just do not understand what this error message is supposed to tell me...
bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
bei Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
bei Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(String fileName, FileAccess access, String createTemplate, Boolean addToHostList, Boolean nestedItem)
bei Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomProvider.OnParseBegin(TextReader reader)
bei Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
bei Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
bei System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
bei Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
bei Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
bei System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
(Nothing in Errorlist)

Related

How do I prevent Xamarin Forms apps from breaking, when I switch between different projects/apps?

I have multiple Xamarin Forms projects for different apps.
Sometimes when I switch between the projects or create a new one, every single app shows one of various error messages, preventing it from starting.
Usually I "fix" this, by deleting the broken project and restarting my computer, however this time it still doesn´t work. The error messages keep showing up, even my main project (which usually works fine) is bugged now.
Is there some sort of cache or some process that I can delete? Does someone know any other way of fixing this without deleting projects?
Each project seems to have different issues, here are 3 of the error messages that appear. I didn´t copy the other ones when I had the chance.
First:
Fehler Fehler beim Generieren des Java-Typs für die Klasse "AndroidX.Core.View.Accessibiity.AccessibilityManagerCompat/IAccessibilityStateChangeListenerImplementor" aufgrund von MAX_PATH: System.IO.DirectoryNotFoundException: Ein Teil des Pfades "C:\Users\trygve.defreese\source\repos\Eigen\Vorlagen\Mehrsprachigkeit mit I18n\LanguageSupportI18n\LanguageSupportI18n.Android\obj\Debug\110\android\src\mono\androidx\core\view\accessibility\AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.java" konnte nicht gefunden werden.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
bei Microsoft.Android.Build.Tasks.Files.CopyIfStreamChanged(Stream stream, String destination) in /Users/builder/azdo/_work/2/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:Zeile 170.
bei Xamarin.Android.Tasks.GenerateJavaStubs.CreateJavaSources(IEnumerable`1 javaTypes, TypeDefinitionCache cache). LanguageSupportI18n.Android
Second:
Fehler MSB4018 Unerwarteter Fehler bei der XamlCTask-Aufgabe.
System.Runtime.Serialization.SerializationException: Die Assembly "Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e" kann nicht gefunden werden.
Server stack trace:
bei System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
bei System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
bei System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
bei System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
bei System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
bei System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
bei System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
bei System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
bei System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)
Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei Microsoft.Build.Framework.ITask.Execute()
bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() BDE_App C:\Program Files (x86)\Microsoft\Xamarin\NuGet\xamarin.forms\5.0.0.2012\buildTransitive\Xamarin.Forms.targets 119
Third(this one appeared 15 times at once):
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler failed to open directory: Das System kann die angegebene Datei nicht finden. (2). Testprojekt5.Android C:\Users\trygve.defreese\source\repos\Eigen\Übungen\Testprojekt5\Testprojekt5.Android\obj\Debug\110\lp\51\jl\res
Edit:
Steps to reproduce the issue:
Open a Xamarin Forms project
Load project to mobile device
Open a second Xamarin Forms project, leaving the first one open
Load second project to mobile device
This usually provokes the issue, I cannot guarantee it though.

AWS CDK - How do you fix the "Fatal process OOM in insufficient memory to create an Isolate" error?

I am trying to work some examples with the AWS CDK using C# as the language. My platform is Windows 10. Edit: I forgot to mention, I'm using a 64-bit Windows 10 and I have 16 GB of RAM.
I've followed the Getting Started instructions here: Getting Started With the AWS CDK, including making sure I have all the prerequisites.
I can create a project just fine, but when I try to use synth or deploy, it get the following:
Unhandled exception. Amazon.JSII.Runtime.JsiiException: Child process exited unexpectedly:
#
# Fatal process OOM in insufficient memory to create an Isolate
#
at Amazon.JSII.Runtime.Services.Runtime.ReadResponse()
at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
at Amazon.JSII.Runtime.Services.Client.Hello()
at Amazon.JSII.Runtime.Services.ServiceContainer.BuildServiceProvider(ILoggerFactory loggerFactoryOverride)
at Amazon.JSII.Runtime.Services.ServiceContainer.<>c.<.cctor>b__8_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Amazon.JSII.Runtime.Services.ServiceContainer.get_ServiceProvider()
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase..ctor(Type nativeType, String fullyQualifiedName)
at Amazon.JSII.Runtime.Deputy.JsiiClassAttribute..ctor(Type nativeType, String fullyQualifiedName, String parametersJson)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
at Amazon.JSII.Runtime.ReflectionUtils.GetClassAttribute(Type type)
at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
at Amazon.CDK.Construct..ctor(DeputyProps props)
at Amazon.CDK.App..ctor(IAppProps props)
at CdkHello.Program.Main(String[] args) in C:\VSTS\Sandbox\Hampson\cdk-hello\src\CdkHello\Program.cs:line 12
Subprocess exited with error 3762504530
Program.cs, line 12 is a generated line, unchanged from it's initial form.
I have searched repeatedly for this error, and all the search results point to node.js. But none of the solutions (all involving some form of setting max-old-space-size) work to clear this for me. As far as I can tell, all my Node and JS installs, as well as the CDK install are up to date.
I can repeatedly duplicate this by creating a new project, then trying to run synth or deploy on it:
cdk init app --language csharp
cdk synth
I've been struggling with this for several days and have no more ideas. Any suggestions would be welcome.

log4net: error could not create appender [RollingLogFileAppender]

So, I have a project in git repo, and 2 branches: master and fix-master.
I've not changed code associated with log4net in fix-master. But every time, when I've started master - I don't have this problem, if I checkout to fix-master, I have this error after this line:
private static readonly ILog Log = LogManager.GetLogger(typeof(Program));
Aside from the obvious candidates (illegal filepath, permissions error), the problem could even be mutex locking:
https://issues.apache.org/jira/browse/LOG4NET-506
RollingFileAppender locking log folder in some cases
Abstract:
In some configuration cases, the rolling file appender may
issue a mutex lock on the folder name. If more than one processes try
to do that with different executing identity, only one will be able to
log to its specific logs file. The others will no more be able to do
it.
SUGGESTION:
Add this line to your app.config/web.config, under appSettings, to enable internal debugging:
<add key="log4net.Internal.Debug" value="true"/>
This will give you output like this, to both the system console and to System.Diagnostics.Trace
log4net:ERROR Could not create Appender [RollingLogFileAppender] of type [log4net.Appender.RollingFileAppender]. Reported error follows.
System.UnauthorizedAccessException: Access to path 'D__Logs_' denied. (Translated from french)
à System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
à System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
à System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
à System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
à System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
à log4net.Appender.RollingFileAppender.ActivateOptions()
à log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement)
log4net:ERROR Appender named [RollingLogFileAppender] not found.
Please try this, and post back what you find!

Error when embedding report viewer dll using costura

I am creating a winform apps in vs2019, create report via Report viewer and it's work well. However, when i embed the dll using Fody/Costura, somehow the report viewer give an error.
I also try manually embed the dll, but the same error still occur.
The error message appear in report viewer,
An error occured during local report processing.
The definition of the report " is invalid.
An unexpected error occured in Report Processing.
The type initializer for "Microsoft.Reporting.Services.ReportIntermediateFormat.Persistence.IntermediateFormatVersion" threw an exception.
The path is not a legal form.
Any help would be very appreciated. Thanks.
I encounter the same problem today. Base on the inner exception, it seems report viewer need to get the version of it's related dll to work correctly. If the dll is embeded, report viewer couldn't locate it.
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NewNormalizePath(String path, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at System.Diagnostics.FileVersionInfo.GetFullPathWithAssert(String fileName)
at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion.<>c__DisplayClass2_0.<.cctor>b__0()
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1_0.<Run>b__0(Object state)
at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion..cctor()
--- End of inner exception stack trace ---
After some trial and error, I found that for report viewer working correctly, 'Microsoft.ReportViewer.ProcessingObjectModel' and 'Microsoft.ReportViewer.Common' need to be exclude from Fody/Costura. Following is the FodyWeavers.xml I'm using.
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura>
<ExcludeAssemblies>
Microsoft.ReportViewer.ProcessingObjectModel
Microsoft.ReportViewer.Common
</ExcludeAssemblies>
</Costura>
</Weavers>

AppDomainUnloadedException when TFS is cloning git repos for a build

Suddenly, when queuing builds in TFS based on a git team project, I get the following stack trace.
Exception Message: Attempted to access an unloaded AppDomain. (type
AppDomainUnloadedException) Exception Stack Trace: Server stack
trace: at
LibGit2Sharp.Core.NativeMethods.git_clone(RepositorySafeHandle& repo,
String origin_url, FilePath workdir_path, GitCloneOptions& opts) at
LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir,
GitCloneOptions& opts) at LibGit2Sharp.Repository.Clone(String
sourceUrl, String workdirPath, CloneOptions options) at
Microsoft.TeamFoundation.Build.Activities.Git.GitPull.GitClone.GetRepository(String
repositoryUrl, String workingFolder, Boolean checkoutSubmodules) at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Object[]& outArgs) at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
msg, IMessageSink replySink)
Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message
reqMsg, Boolean bProxyCase) at System.Func4.EndInvoke(IAsyncResult
result) at
Microsoft.TeamFoundation.Build.Activities.Git.GitPull.GitRepositoryBase.EndExecute(AsyncCodeActivityContext
context, IAsyncResult result) at
System.Activities.AsyncCodeActivity1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext
context, IAsyncResult result) at
System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor
executor, BookmarkManager bookmarkManager)
I changed nothing for this to happend, googling so far I found info about it perhaps being macafee, but we dont use that on our build agent.
Using an on-premises build server
Normal TFS team projects build as expected
Resolved by restarting the server - not sure how I didn't think of that.

Categories

Resources