简体   繁体   English

添加Dynamics GP命名空间Visual Studio项目

[英]Add Dynamics GP namespaces Visual Studio project

I need to add the following namespaces 我需要添加以下名称空间

• Microsoft.Dynamics.Common
• Microsoft.Dynamics.Common.Types
• Microsoft.Dynamics.GP.BusinessLogic
• Microsoft.Dynamics.Common
• Microsoft.Dynamics.GP

to my project in Visual Studio, 到我在Visual Studio中的项目,

Kindly suggest how I can do so. 请建议我该怎么做。

First you need to add references to the libraries to your project. 首先,您需要将对库的引用添加到您的项目中。 Right click the project name and select "Add Reference" or if the project shows a references folder right click that and choose to add. 右键单击项目名称,然后选择“添加引用”;如果项目显示引用文件夹,请右键单击该文件夹,然后选择添加。 If the library doesn't show in the list then browse to where ever it is located and select it. 如果该库未在列表中显示,则浏览到它所在的位置并选择它。

Then at the top of the file add a using command. 然后在文件顶部添加using命令。 For example: using Microsoft.Dynamics.Common; 例如:使用Microsoft.Dynamics.Common;

Please feel free to post additional questions. 请随时发布其他问题。

Either Download and install the SDK on your machine, It will include the dlls needed to integrate with dynamics or copy the dlls from where ever you have them. 在您的计算机上下载并安装SDK,它将包括与动态集成所需的dll或从任何位置复制这些dll。 (make sure you get the correct version for GP). (确保为GP获得正确的版本)。 From there you should create a folder in your project to hold the files in one place and copy them there. 从那里,您应该在项目中创建一个文件夹,以将文件保存在一个位置,然后将其复制到那里。 Once you have the library files you add references to the files by going to the browse sections of the reference manager and then browsing to the where you copied the files. 一旦有了库文件,就可以通过转到引用管理器的浏览部分,然后浏览到复制文件的位置,来向文件添加引用。 (Quick note. make sure that you set copy local to true so that it will include the files locally when running and not look for them in the GAC). (快速说明。请确保将copy local设置为true,以便在运行时它将在本地包含文件,而不要在GAC中查找它们)。 Once referenced you should be able to access the namespaces and include them with using keyword as needed. 引用后,您应该能够访问名称空间,并根据需要using关键字将其包括在内。

If in case you are not getting the required dlls even after installing SDK, then add required Nugets online in visual studio(and later). 如果安装了SDK后仍未获得所需的dll,请在Visual Studio(及更高版本)中在线添加所需的Nuget。 After that you can start using the keyword "using" in your VS project. 之后,您可以在VS项目中开始使用关键字“ using”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM