C # assembly not found at runtime
Strange error occurs with my XNA project on a new PC. I have two projects to solve and a library that is used by both of them. One of the projects, the XNA Game Project, works great. Another project is a mix of WindowsForm and XNA. The form runs the XNA class when the button is clicked. When I run the program, it works fine until the moment I click the button that launches the XNA class. The FileNotFoundException is thrown exactly when the constructor is executed.
System.IO.FileNotFoundException was unhandled Message="Could not load file or assembly 'Microsoft.Xna.Framework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies. The system cannot find the path specified."
The link is correct, no compilation problems. We already tried to remove the link and add it again, but it didn't work. Everything worked correctly in other team games.
Does anyone know what the problem is?
Hey Gustavo, looks like you did this a long time ago:
http://blogs.msdn.com/b/shawnhar/archive/2008/02/25/xna-framework-on-64-bit-windows.aspx
It looks like the CLR was trying to find a 64-bit version of XNA for which it doesn't exist, so creating a new project under the XNA Project works as it's 32-bit by default.
Just leaving it here for reference, also close this question, select an answer .: 3
Check your config file for references to this DLL. Most similar to a type loaded through reflection. I see these types of errors with Ent Lib.
If this file is in the GAC on your teammate's computer, or you have different config files, this error will not be displayed.
NTN
Brian
You can try using depends.exe from the sdk platform to investigate the missing dependency. I assume you have manually checked the file in the right folder?
Also, there are problems with this dll on x64
I solve the problem with a workaround:
I create a new XNA project and move everything there, then added links to WindowsForm. The build problem was no longer repeated!
Thanks for the help.
You can use fuslogvw or any of the other things mentioned to find the root cause. You can also capture the event AssemblyResolve
and manually load the assembly in context From
or Neither
.