Trouble with Visual Studio 2010 and ResGen

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Trouble with Visual Studio 2010 and ResGen

Post by drtech » Thu Nov 18, 2010 5:58 am

I followed the instructions on the developer page for fixing the ResGen issue, but it still won't build my plug in. I can build the main program fine. I followed the link to the Microsoft discussion but don't understand where to put the fix for continued section for workaround 2 :
Adding <ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture> to a PropertyGroup in the project file of any project that generates resources targeting .NET 3.5 – since the corflags trick affects the bitness of ResGen.exe on a system-wide level, the property must be set for all affected projects as well.

2. OR If running MSBuild.exe directly, passing it using the global property switch: ‘/p:ResGenToolArchitecture=Managed32Bit’

3. OR Setting it as an environment variable in the command window that MSBuild.exe is run from or the VS 2010 IDE is opened from: ‘set RESGENTOOLARCHITECTURE=Managed32Bit’
Where is the PropertyGroup and so where do I find this to put the entry?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by drtech » Thu Nov 18, 2010 5:35 pm

here is the error i get


Error 15 Failed to execute command: ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" /useSourcePath /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /r:C:\svn\beta\OpenDental\bin\Debug\OpenDental.exe /r:C:\svn\beta\OpenDentBusiness\bin\Debug\OpenDentBusiness.dll "/r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /compile ContrAccountP.resx,obj\Debug\PluginDrTECH.ContrAccountP.resources ContrChartP.resx,obj\Debug\PluginDrTECH.ContrChartP.resources FormFromToolbar.resx,obj\Debug\PluginDrTECH.FormFromToolbar.resources FormOptions.resx,obj\Debug\PluginDrTECH.FormOptions.resources FormPtDash.resx,obj\Debug\PluginDrTECH.FormPtDash.resources". The handle is invalid. C:\svn\drtechplugin\TRACKER PluginDrtech
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by jordansparks » Fri Nov 19, 2010 6:53 pm

Open one of the project files in a text editor. Look at where we stuck that line and immitate it in the project file for your plugin.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by drtech » Sat Nov 20, 2010 5:34 pm

ok, solved that problem, but now I am getting those PDF sharp reference errors and such...why does that happen all the time in Visual Studio? why can't they get it to remember the references.....

...can't remember how i fixed it before...the references look right but it doesn't work
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by drtech » Sun Nov 21, 2010 5:14 pm

ok, got the dll dependencies re-established.

Now I have another error I have never seen and don't know where the problem is:

"Bad Image Format Exception Unhandled:
Could not load file or assembly 'CodeBase, Version=7.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

this occurs in OpenDental.ProgramEntry.cs line 42 ...which is:

FormOpenDental formOD=new FormOpenDental(cla);

This only happens when I build my plugin solution, so something I have set wrong. Any ideas to help me?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by jordansparks » Tue Nov 23, 2010 11:51 am

That's just your solution configuration settings. Remember to build for x86 instead of all platforms.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Trouble with Visual Studio 2010 and ResGen

Post by drtech » Tue Nov 23, 2010 7:40 pm

thanks...I thought I had reset that and didn't think to check it again. Fixed it like magic. :)
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply