Select to view content in your preferred language

Adding AxLicenseControl causes error vb.net studio 2010

2531
3
07-02-2010 06:14 AM
NathanKirby
Deactivated User
After installing and licensing EDN Engine 10. I'm getting

Error 1 Could not load file or assembly 'file:///C:/Program Files (x86)/ArcGIS/DeveloperKit10.0/DotNet/ESRI.ArcGIS.3DAnalyst.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 127, position 5. C:\Users\njkirby\Documents\Visual Studio 2010\Projects\RigUpdater\RigUpdater\Form1.resx 127 5 RigUpdater


error when trying to compile with just a form and the AxLicense control on the form. removing the control and the app compiles and runs fine.

I've verified that the 3DAnalyst is actually in the location its looking.

anyone have some pointers? removed and reinstalled and still no luck.
0 Kudos
3 Replies
RalfGottschalk
Esri Contributor
Hi njkirby,

This issue is a known issue with Visual Studio 2010 and Microsoft has the following KB document about it.

http://support.microsoft.com/kb/2028833

What is happening is when you target the .NET 3.5 framework on a 64 bit os using Visual Studio 2010 and reference a 32 bit assembly in your resource file (.resx), such as the Esri Controls, and you hit compile, Visual Studio launches an executable called �??ResGen.exe�?�.  This executable is compiled as �??Any CPU�?�.  So, on a 64 bit machine it runs as a 64 bit process and is looking for the 64 bit version of the assembly which it can�??t find it because it doesn�??t exist.

The Microsoft workaround changes the header file on the ResGen.exe to force it to run as 32 bit. 

We will have a KB doc that should be available really soon with a workaround for this problem that you can add to your Visual Studio project that will change the header file at compile time and then change it back when it is done.  I�??ll post the link as soon as it is up.
0 Kudos
NathanKirby
Deactivated User
Ralfg

thanks for the information ... following the MS KB allowed me to be able to compile with out errors.
0 Kudos
RalfGottschalk
Esri Contributor
The KB document has been published and can be found here:

http://resources.arcgis.com/content/kbase?fa=articleShow&d=37879
0 Kudos