Visual Studio Upgrade MS Dynamics GP

rwheeler23
rwheeler23 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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
rwheeler23President

Author

Commented:
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

Commented:
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
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

rwheeler23President

Author

Commented:
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?
Commented:
Hi Richard,

Sorry, I wasn't clear about the two versions.  You should have the DLL in both of these locations:

C:\Program Files\Common Files\Microsoft Shared\Dexterity\v2.0

C:\Program Files (x86)\Common Files\microsoft shared\Dexterity\v2.0

If you choose the one in Program Files, that should be the 64 bit version.  If you choose the one in the Program Files x86 directory, that should be the 32 bit version.

From what I can tell, the Microsoft Shared\Dexterity\v2.0 folder and files are created during the GP installation, as it have it on all of my servers.

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
rwheeler23President

Author

Commented:
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.
rwheeler23President

Author

Commented:
Excellent and very well expressed solution.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial