My Android Application works fine but when I launch my UWP application it crashes in the OnLaunched of my App.xaml.cs at the line of Xamarin.Forms.Forms.Init(e)
This is the error I'm getting:
System.IO.FileNotFoundException: 'Could not load file or assembly
'clrcompression, Culture=neutral, PublicKeyToken=null'. The system
cannot find the file specified.'
It completely makes my app crash, only thing I can see is my Splashscreen.
In IOS got a similar issue. It also show an error of FileNotFoundexception but it doesn't break and I can go past it. It show the error in my Main.cs at the line of UIApplication.Main(args, null, "AppDelegate");
As discussed in the comments of the original post, and for anyone else that stumbles accross this thread with the same exception, in most instances the cause would appear to be related to Xlabs assemblies either not loading correctly, or having not been removed completely. This appears to have been an issue for at least the last half a year (past example of similar situation can be found Here).
The solution in this instance if you removed the xlab references but still get the error, is to delete the obj/bin/.VS folders from your project folder. Then for a UWP project, rebuild and then deploy. The issue should be resolved.
Related
I have a working Xamarin.Forms project that was building fine, when suddenly (after Visual Studio had been closed/reopened, presumably after some update), I started getting the following error:
Failed to resolve assembly: 'MYAPPNAME, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
How do I resolve this error? It doesn't give me a file or location where the problem is, & ProcMon doesn't appear to be helpful either.
Xamarin.Forms scaffolding apparently will sometimes build a circular assembly reference.
The broken reference will be in one of your XAML files and look like this:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MYAPPNAME;assembly=MYAPPNAME"
... />
The problem is that at some point Xamarin stuffed in the assembly=MYAPPNAME text.
In some cases, your previously built assembly is either gone/not usable, and therefore this assembly reference is trying to resolve itself before the project is ever built - i.e. it will never work.
Simply remove the bolded text above, save your XAML file, rebuild and everything should be fine - if you still get the same error, you may have other circular reference in other XAML files.
Bug with Xamarin/MSFT pending.
I started getting the following error in UWP today and have no explanation as to where it came from
C:\Users\chris.nuget\packages\microsoft.net.uwpcoreruntimesdk\2.2.9\tools\CoreRuntime\Microsoft.Net.CoreRuntime.targets(195,9):
Error
Framework resource extraction failed. This .resources file should not be read with this reader. The resource reader type is "System.Resources.Extensions.DeserializingResourceReader, System.Resources.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
btw: line 195 of Microsoft.Net.CoreRunTime.targets is
<ResourceHandlingTask
AssemblyList="#(_FullAppLibrariesUnfiltered)"
OutResWPath="$(ResWOutputFullPath)"
SkipFrameworkResources="$(SkipMergingFrameworkResources)"
StateFile="$(ResWOutputFullPath.TrimEnd('\'))\ResourceHandlingTask.state">
I've tried checking out a previous version of code in Git when everything built and this little beauty is still there. Cleaning all projects, updating to the latest Visual Studio, reverting nuget packages, nothing seems to help.
Any ideas?
After updating Visual Studio 2017 to 15.5, I'm no longer able to debug my unit tests (I can run the tests fine, and I can debug non-test programs).
I keep getting the following exceptions:
Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' or one of its dependencies. The module was expected to contain an assembly manifest.
Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'VSTestVideoRecorder' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' or one of its dependencies. The module was expected to contain an assembly manifest.
Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'VSTestVideoRecorder' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Exception thrown: 'System.ArgumentException' in System.dll
FrameworkName cannot have less than two components or more than three components.
I've confirmed that each project is consistently using the same compiler setting (7+ w/ minor versions), and are all targeting .Net 4.7. Except for updating VS to 15.5, the code in some of the files at issue have not changed at all.
I haven't found anything helpful about these exceptions or about how to address them. It certainly seems like something caused by the VS update.
Any ideas? Is reinstalling VS the only solution?
Just got same issue.
I start search around for solutions and after doing some things, somehow, the problem got fixed.
What I have done was:
Deleted all my %temp% folder (insane hum?)
Commented all my bindingRedirect and test solution app.config (i
needed)
Deleted the content of my packages folder
Updated my Visual Studio 2017 to latest version (15.5.2)
Don't know witch step make it work (or combination of steps). Made lots of tries.
And voilĂ , it worked.
Hope this helps you.
im receiving a very weird error from the IDE while compiling.
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for
Phone\v4.0\Microsoft.Phone.PreImport.targets(38,9): error : Could not
load file or assembly '0 bytes loaded from System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
what really makes this weird is the fact that on another computer the program is compilable.
thanks for your help
edit: just found out that the reason for that error is because of the panorama -view.. i tried to create a new project with a panorama view, still received same error
Do you have the correct references in the project?
Did you modify any of the "stock" references?
You could try repairing the SDK or create a new Panorama-based application and see if it works.
This error message appears on a colleague's machine when he tries to launch a Windows application he's working on:
An unhandled non-continuable exception was thrown during process load
What does this mean, and how does one go about investigating what is causing it?
I have Googled it, but haven't found a clear answer. It seems to have something to do with problems loading DLLs.
Right I'm looking over this issue in my own code at the moment - for anyone who is having this issue, here's some pointers:
There is a fairly involved thread discussing it here: http://bytes.com/topic/net/answers/555706-unhandled-non-continuable-exception-thrown-during-process-load
Are you linking to Winmm.lib? It's got problems, can you avoid using it?
Are you using C++/CLI? If so, consider delay loading the C++/CLI module.
Any other hints, please post - this crops up from time to time and can be problematic!
More details are on: http://www.dwmkerr.com/post/2012/02/08/Debugger-An-unhandled-non-continuable-exception-was-thrown-during-process-load.aspx
Is there more information in the error message, maybe in the debug console? If there's a stack trace available, it might point you to the problem application, or better yet, the DLL that's causing the problem. The next step would be to see if there's an update available for that DLL.
I found that enabling the "Read&Execute" permission on a dll that was checked in to version control solved this problem.
The first thing I tried was to copy my whole Debug/ directory somewhere and the app ran fine there, then I checked the properties of each of the original dlls and enabled execute.
I had the same issue and it turned out that a DLL compiled for x64 in a x86 project was the culprit. Replacing the DLL with the x86 version resolved the issue.