0

I have vb.net windows form application(.net 4.5), I have recently added a c# based class library project in the solution and one of the vb.net projects is referencing this project. When i build the solution in Debug any cpu mode everything works fine but when i build it in release any cpu mode I get the following exception

Could not load file or assembly 'TagWriter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Any help would be appreciated.

Thanks

5
  • Check stackoverflow.com/questions/8996653/… or stackoverflow.com/questions/4340362/…. Check your build configuration for Release. Aug 18, 2014 at 9:43
  • My build configuration i.e the main solution build configuration is release any cpu and the tag writer project is also on release any cpu. I have checked all the configurations all are on the same configuration
    – sagar
    Aug 18, 2014 at 10:21
  • Maybe delete bin folder, restart VS, try to rebuild? It is very probably not connected with mixing C# and VB.NET. The error comes during build or when you execute your app? Aug 18, 2014 at 11:50
  • The solution build configuration name "AnyCPU" is completely meaningless to a VB.NET project. Only the jitter forcing matters. Which you surely forgot to change for the Release configuration. Right-click the project, Properties, Compile tab. Aug 18, 2014 at 12:13
  • .. > Advanced Compile Options > Target CPU to "AnyCPU". For C# it is Build tab > Platform Target. I can see "Any CPU" option there, so please @HansPassant what do you mean by saying that it is meaningless? Aug 18, 2014 at 18:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.