getting unspecified error while compiling a WP7 program - windows-phone-7

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.

Related

Xamarin.Forms Shared Project - Failed to Resolve Assembly

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.

Any ideas on how to handle a Framework resource extraction failed. error that mysteriously started showing up in UWP

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?

Xamarin.Forms.Forms.Init(e) FileNotFoundExeception in Onlaunched

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.

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0

I've had a look at similar postings but haven't found one that has helped fix this issue.
Just briefly, I have an mvc3 project running on azure. A couple of days ago it lost it's reference to System.Web.MVC for some reason. So I added the reference and changed the Copy Local property to True.
It built and ran on the local emulator ok. I then published it and got the following message when visting the website.
"Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0"
It turns out I only version 3.0.0.1 and not 3.0.0.0 which is stated in my web.congig file. I've tried changing the value in web.config in both the assembly and runtime sections to 3.0.0.1 but this throws another exception in azure.(although didn't change the Public Token)
I've also tried Add Deployable Dependency but this has made no difference and I've tried downloading and adding vers 3.0.0.0 to the project but vs didn't like this dll when publishing.
I've also tried changing the property Specifc Version for the assembly to False but this hasn't worked.
So for some reason I don't have v3.0.0.0 anymore but don't know how to change my project to use v3.0.0.1 I guess.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 39:
Line 40:
Line 41:
Line 42:
Line 43:
Source File: E:\sitesroot\0\web.config Line: 41
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Thank's guy's. I actually just commented out the assembly line of code for the mvc assemble and changed the runtime binding code to look for v 3.0.0.1 in web.config and this has done the trick. I'm not sure if that was the best solution but having spent over a day on it time was a big factor.
I was getting a very similar error
My solution had previously been working and nothing had changed apart from some activities using source control
I created a completely new workspace and checked out the entire source code again to the new workspace, and this fixed the issue (just doing a 'get' and a 'Get Specific Version' wasn't enough)
Looks like something had got screwed up in my workspace that prevented the compiler from finding the correct .dll. Possibly related to finding it in the GAC?
I have had this problem on and off randomly for a while and I now know why.
When you update a nuget package and the package has a web.config file as part of the nuget package, it merges the content of web.config file in the nuget package with your config file. The nuget package was a private package that I build and didn't realise this.
The web.config file in the package contained the binging redirects for MVC and this causes my config file to suddenly have duplicate entries. I initially missed it because it does all the binding redirects on one line.
Once you remove any duplicate binding redirects it fixes the problem. This question was big clue to me finding out what causes this.

Nunit fails to start my application

Visual Studio 2010 Express C#, NUnit 2.5.8, White 0.2.0
I am trying to write some tests with the NUnit + White framework.
I can get the White demo (ListBoxExample) up and running without problems.
But when I write a simple test for my own application (.Net 4.0), I have 2 problems:
Application.Launch(""):
This statement does not complain, but does NOT launch my application at all. The path is correct because if I put an incorrect path, I get an error. With the right path there are no errors, but no application is starting.
application.GetWindow(...)
This statement causes an error:
DocBackupTestSuite.Tests.StartupTest: System.IO.FileLoadException : Could
not load file or assembly 'Bricks,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its
dependencies. The located assembly's
manifest definition does not match the
assembly reference. (Exception from
HRESULT: 0x80131040)
But the Bricks.dll file IS referenced in my project...
Thank you for your help
Davy
First problem is solved.
The code did not wait long enough to leave time for the application to start.
Added a Thread.Sleep(10000) after the Application.Launch() statement, and now it starts up.
2nd problem is still pending...
Anyone?
2nd problem also solved:
A reference to Bricks.RuntimeFramework was missing.
After adding this, my test runs fine ;)
If you face this problem below when you use the UI automation library(White-project)
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Bricks,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=83a26c96fb92c77f' or one of its dependencies.
The system cannot find the file specified.
File name: 'Bricks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=83a26c96fb92c77f'
please take the following solution:
Add Reference of the dll list as follow:
•Bricks
•Bricks.RuntimeFramework
•Castle.Core
•Castle.DynamicProxy2
•log4net
•nunit.framework
•White.NUnit
•Xstream.Core
Hope your code can be work successfully now.
Download theses stuff here
http://white-project.googlecode.com/svn/tags/0.20/lib/
Reference fromhttp://sunshinetoast.com/Default.aspx

Resources