I reloaded an old project, and tried to run it only to run into the Binding Failure MDA Assistant:
BindingFailure was detected
Message: The assembly with display name 'SoapTest.XmlSerializers' failed to load in the
'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was:
System.IO.FileNotFoundException: Could not load file or assembly
'SoapTest.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. The system cannot find the file specified.
After googling this, the only solution I could find was to turn off the MDA. This works, but I would prefer to solve the underlying problem (SoapTest.XmlSerializers.dll not being in the bin\Debug directory). How can I fix this? What creates the SoapTest.XmlSerializers.dll, and why is it not being created on a Rebuild? Yes, I have tried updating the Web Reference (this doesn't help). No I don't want to upgrade to WCF Soap Services.
actually yes , i went to the propensities window and set the option of "Generate serialization assembly" to "on" , by this you insure every time you build the project ,
i guess that error happens when you edit the assmbly info of the class library you are referencing without re building it
In VS.NET you can go to the project settings and try different settings for XmlSerialization - I believe there is a setting for auto that you may want to disable.
I also encountered this issue. The problem was that the project causing the Exception was created in another folder than the .exe file. I easily resolved it by changing the Deployment Path from Properties/Build settings page. No other change on "Generate serialization assembly" was necessary.
Related
I've created a Class Library in C# .Net Framework 4.8, and in the solution I've also included a Console Application, same target.
I'm running both in a x64 configuration.
No errors on build.
I referenced the App in the Library, and when I run a Button in a Form in the Class Library I'm getting an error:
System.IO.FileNotFoundException: Could not load file or assembly
'ExampleApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or
one of its dependencies. The system cannot find the file specified.
File name: 'ExampleApp, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'
I've combed the internet and SO for a solution. I tried repairing Visual Studio, I tried deleting the .vs folder in the projects, I tried things like:
solution 1
and
solution 2
I seriously tried everything I could think of. It has to be something to do with the .dll dependencies imho, because the only one that my ExampleApp is using is the Microsoft.CognitiveServices.Speech reference which I installed via NugetPackage in my solution.
No idea how to debug this further or get a proper trace stack from this error...
Any ideas on how to proceed?
Thanks
Solved by changing the .dll's Copy Local property to True
Exactly #Yafim Simanovsky, I solved also my problem by changed <Private> flag to True.
My problem (“Could not load file or assembly…”) was with new Designer ‘WpfSurface.exe’ from VS 2022, which after changing the reference tags ‘Private’ to True, was able to copied all dependent .dll files to Cache.
I've created a commandline program which I'm compiling and executing. So far so good.
The solution consists of 2 projects. The main project and the data project (with the main project being the executeable and startup proejct and the data project handling the sql connections).
It works fine BUT: Whenever I move the .exe out of the folder it has been created in it tries to find the data project and fails to do so and thus the execution of the .exe fails.
The error message is:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or
one of its dependencies. The system cannot find the file specified.
at MyProject.Program.Main(String[] args)
I've never encountered this problem before as both projects are part of the same solution and in the compile folder it works.
Anyone can give me a hint as towhat could be the cause here?
Notes: The project itself has the default settings as has the solution.
Also like mentioned I have never encountered such a problem before as normally I only just move the .exe and don't need to also move (separately) the .dll of the other projects. At least I never consciously encountered this problem before there. If I included external projects then yes then it was necessary to also have the .dll there if I said reference by copy. But in this case its a second project of the same solution and there I never had this before.
I'm getting the following runtime error in my WCF service.
Could not load file or assembly 'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
After some looking around, I found a suggestion to use Assembly Binding Log Viewer, or Process Monitor. Neither or which yielded any information (that is, the log viewer showed nothing at all, and the process viewer didn't see the assembly load being attempted.
I finally came across a suggestion to use this utility (dependency walker) to find out what the assembly was actually looking for. On opening, I got an error immediately; and the log stated the following:
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
According to the module list, it couldn't find these:
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
IESHIMS.DLL
Some of these look like they relate to the RT framework; however, this application was developed in .NET 3.5 (actually, that's not strictly true - it was developed in 4.5 and downgraded to 3.5).
Looking at some of these files seems to imply they are quite core Windows files, and oddly, I have used this dll elsewhere in the solution (admittedly on the client) without issue.
I'm using VS2013 although I've tried VS2012 and get the same issue.
I did come across this question which at first glance seems to be the same, although it relates to C++.
Can anyone give me some guidance as to what the issue might be, or what to try next?
Here is my fusion log:
=== Pre-bind state information ===
LOG: DisplayName = MyAssembly.MyLib.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL (Fully-specified)
LOG: Appbase = file:///c:/myprog/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = myprog.exe
Calling assembly : System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\myprog\bin\Debug\myprog.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
I managed to reduce the library in question down until it was just a single static function that returns a string, and still get the error.
The thing that always helped me with resolving this error was to take closer look at the part of the error message which says "or one of its dependencies".
Visual Studio with WCF has a quirk - if you build using a selected platform, it dumps the assembly in a platform-specific folder. If you build with "Any CPU" it puts it in the root of your WCF's "Bin" folder.
When it configures IIS to help you? It automatically assumes your assemblies will be in the root of that "Bin" folder.
The net event is that when you select "x86" instead of "Any CPU" you end up with the assemblies built in the wrong spot and suddenly your WCF does not run. So this is one of the few rare cases where the catch-all error about not being able to load your file or assembly is telling the literal truth - Visual Studio put your assembly in the wrong place and now it can't find it.
I have no idea why they did it like that. WCF has some... interesting design decisions.
If you have multiple projects, it is possible some of them are not building when you run the application in Visual Studio. Right click on your solution, then go to Properties, Configuration Properties and confirm all the projects are set to compile.
So the library that is part of your WCF service has one method and that is the problem method.
Can the method and it's reference be removed and does the runtime error go away?
It would be helpful if you could post the source to the project file and you should consider recreating the project file from scratch.
In that way if there are any stale references to 4.x they will be removed, please post more about your progress...
I've always found that could not find is always because it is not there.Sounds perhaps obvious but sometimes helpful to get the mind right => There is something which is not there.Next well if you remember the principle of decoupling the definition from the implementation it goes to imply that your library containing the interface and the service should move to an external dll to the service. now that you've externalized the acting code, if that builds in itself, you've only the implementation left. Which being a downgraded solution a pragmatic approach is that the project has become 'funny'. Make new project specific to your task an version and since it very likely only now contains reference to your library and a file with one line called something like thisismyservicename.svc as well as an address and a binding it should be pretty easy to copy the system.servicemodel part of your web.config. Now you have nothing left in your original project and can flush is safely.
Looks like I'm not the only person that's been here. I'll leave this up in case it helps anyone else:
http://social.msdn.microsoft.com/Forums/en-US/9f0c169f-c45e-4898-b2c4-f72c816d4b55/strange-xmlserializer-error?forum=asmxandxml
Just ignore the error... that how it's supposed to work!?
EDIT:
I've undeleted this answer for future reference. I finally solved the problem. It wasn't the issue above, it was an IIS problem specific to the solution I was working with. There was a post build to copy compiled WCF binaries to a common location, but that obviously didn't include the new dependency.
I'll award to the closest answer.
I have experienced the same issue with wcf, I have the project working and after adding a wcf service it stop loading the svc file and the same issues, nothing worked for me, and at the end I removed the service and restart the machine, the rebuild everything and at the end I added the service again.
This error generally given while project is developed in greater version of visual studio/Asp.Net and run/deployed machine has a lower version. Firstly check Visual Studio version of both machine.
I am struggling with a problem regarding to visiblox. I am quite new to the WPF concept, but I am getting the hang of it. I have quite some expirence with the classic forms.
My problem is that the designer keeps telling me that the XAML contains errors. And I get the folling error in my error list:
Unable to load the metadata for assembly 'Visiblox.Charts'.
This assembly may have been downloaded from the web.
See http://go.microsoft.com/fwlink/?LinkId=179545.
The following error was encountered during load: Could not load file or assembly
'Visiblox.Charts, Version=2.1.4.31043, Culture=neutral, publicKeyToken=1543c03f04c4461b' or one of its dependencies.
I have added the reference to the project, and I have added the line:
xmlns:charts="clr-namespace:Visiblox.Charts;assembly=Visiblox.Charts"
I can build and run the project, but the designer keeps telling me that my assemblies are not correct. I tried to clean and rebuilt the project. Restarted Visual Studio and the computer, but nothing seems to work. Anyone any clue? Thank you in advance.
I'd suggest following the link it provides: http://go.microsoft.com/fwlink/?LinkId=179545
The problem is that the dll is "locked" by windows security and you need to unlock it before you can reference it. The link specified tells you how.
I have a window and I created a "callout" there. When I try to create the new window with this.InitializeComponent(); I get an exception:
The assembly with display name 'Microsoft.Expression.Drawing.Aero' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Expression.Drawing.Aero, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
How can it be? What is Microsoft.Expression.Drawing.Aero?
The solution can be delete your .suo file and ReBuild your entire solution.
The *.suo file is found in the project root folder.(If you can't see your *.suo file be sure you have configured the windows explorer to see hidden files.)
That is part of the Expression Blend SDK and means that some part of the project has been built via Expression from MS - the SDK itself is AFAIK a free download. Just download and install it to resolve the described situation.
Well, I cannot tell you exactly what did it, but I ran a full purge on non-sourced files and it now works....So, it wasn't the suo, but it was something...
I am just making wild guess. Since the exception is thrown while initializing the Window I assume that the application is trying to load the Aero theme from your machine (I guess Windows 7). See if there is any style defined for the windows which asks it to use Aero theme irrespective of the theme set being used by the OS.
Maybe you are missing Expression Blend SDK (that Dll is part of it)?
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=75e13d71-7c53-4382-9592-6c07c6a00207
If you are using multiple project in single solution, this exception will occurs. I removed my project from solution and ran it separately it works.