Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

Visual Studio Upgrade MS Dynamics GP

I have a class library that was originally written in VS 2008. The time has come to upgrade it to VS 2010. The library belongs with an application that has its own toolkit. I have installed the latest version of this toolkit. The problem I have is that when I build the code and run the application, I get this error message."User generated image
Avatar of Steve Endow
Steve Endow
Flag of United States of America image

Hi Richard,

That message may indicate that you have a broken reference for GPConnNet.dll.  Even though your VS project may not show the broken reference, for some reason GPConnNet usually needs to be removed and readded after an upgrade.

In your VS project, remove the GPConnNet.dll, then add it back by browsing to Program Files (x86) \ Common Files \ Microsoft Shared \ Dexterity \ v2.0 \ GPConnNet.dll

If that doesn't work, try changing your compilation options to target the x86 platform rather than Any CPU.

Give that a try and let me know if that fixes the problem.

(After thinking about it more and re-reading the error--particularly the "incorrect format" message, my money is on x86, but let me know what you find)

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
Avatar of rwheeler23

ASKER

Steve, this is very strange. First I tried changing the CPU to x86 and that did not help. Then I removed the reference to GPConnNewt.dll and put it back and that did not help. Then I noticed that once again when I build VS inserts the GPConnNet.dll file into the GP Add Ins folder. When I delete it, GP runs just fine and so does my code. So one question is how to do I stop VS from depositing this dll into the add ins folder? The other is why do I keep getting this warning when I build?

Warning      2      There was a mismatch between the processor architecture of the project being built "x86" and the processor architecture of the reference "GPConnNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.      SOPWorkSamples
Hi Richard,

If you select the GPConnNet reference and then look in the Properties window, there is a "Copy Local" property.  Make sure that is set to False.

When you add the GPConnNet reference, check which directory you are using.  There appears to be both a 64 bit and 32 bit version.  If you reference the one in Program Files, then set your solution to compile for AnyCPU.  If you reference the one in Program Files (x86), set your solution to compile for x86.

Let me know if those resolve the issue.

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
Steve, this all makes sense now. One last question I have is the x86 vs x64 version of GPConnNet.dll. In my Common Files folder there is only one version. Does the installation of GP create this folder of is it the installation of the GP VS Toolkit?
ASKER CERTIFIED SOLUTION
Avatar of Steve Endow
Steve Endow
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Now it all makes sense. I did not have to do any of this before for GP 10. At least now I know. Thank you very much.
Excellent and very well expressed solution.