Avatar of rwheeler23
rwheeler23
Flag 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."Error Message
DB Dev ToolsC#Microsoft Dynamics

Avatar of undefined
Last Comment
rwheeler23

8/22/2022 - Mon
Steve Endow

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
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
Steve Endow

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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
rwheeler23

ASKER
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
Steve Endow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rwheeler23

ASKER
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.
rwheeler23

ASKER
Excellent and very well expressed solution.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.