如何将Visual Studio连接到特定的Dynamic Axe环境

如何将Visual Studio连接到特定的Dynamic Axe环境

问题描述:

我想将Visual Studio与不同的动态斧头环境连接. 特别是以下两个:

I would like to connect my Visual Studio against different dynamics ax environments. In particular the following two:

  1. 开发环境
  2. 生产环境

目的是开发SSRS报告.在生产环境中,有些报告在开发中不可用,创建它们会很复杂.并不是说我要反对生产发展(谁会做这样的事情?!;-)).

The purpose is to develope SSRS reports. In the production environments there are some reports which are not available in development and it would be complicated to create them. Not meaning that I'm going to develop against production (who would do such a thing?! ;-) ).

我找到了一个教程,该教程显示了如何通过将Visual Studio的启动参数指向AXC文件来连接到特定的AOS:

I found a tutorial which shows how to connect to a specific AOS by pointing visual studios start up parameter to an AXC file:

用于VS连接到特定AOS的教程

当我按照教程中的步骤操作并打开AX时,似乎VS已连接到正确的AOS实例.请参见以下屏幕截图,显示了两个AOS实例,一个实例连接到Development,另一个实例连接到Production:

When I follow the steps from the tutorial and open AX it seems that VS has connected to the correct AOS instance. See the following screenshot, showing two AOS instances one connected to Development the other to Production:

当我打开生产"和开发"中的报告时,我发现它们的设计有所不同,因为开发"中进行了一些更改.

Also when I open the report from Production and from Development I can see that they are different in design, because there have been made some changed in Development.

问题是:当我尝试使用示例数据打开报表时,它总是从我的开发环境中获取数据.我还注意到,SSRS报告参数@AX_UserCompany始终是我在开发"中的AX用户设置中的公司.

Problem is: When I try to open a report with sample data, it always fetches the data from my Development environment. I also noticed that the SSRS report parameter @AX_UserCompany is always the company from my AX user settings in Development.

我知道VS使用我的活动目录用户来对AOS进行身份验证,但是为什么即使使用VS生产AXC文件作为启动来启动VS,它也总是使用开发设置?

I know that VS is using my active directory user to authenticate against the AOS, but why is it always using the Development settings, even when VS is started with the Production AXC file as startup?

我的问题是:VS怎么可能从生产中提取SSRS报表设计,而从开发中提取数据,以及从生产中同时检索(设计和数据)需要做什么?

My question is: How is it possible, that VS pulls the SSRS report design from Production but the data from Development and what has to be done to retrieve both (Design and Data) from Production?

感谢您的任何投入.

我终于可以解决这个奥秘了. 似乎Visual Studio始终使用存储在注册表中的连接属性.尽管报表设计是从AXC文件中指定的AX实例加载的,但数据是从注册表中指定的AX实例中提取的.

I could finally solve the mystery. It seems that Visual Studio is always using the connection properties stored in registry. Although the report design is loaded from AX instance specified in the AXC file, the data is pulled from the AX instance specified in the registry.

解决方案是

  1. 打开Dynamics AX配置实用程序
  2. 导入AXC文件
  3. 应用AXC文件
  4. 刷新配置
  5. 再次申请


在开始之前,请关闭AX和VS(仅在保存侧).


Before you start, close AX and VS (just to be on the save side).

1.打开Dynamics AX配置实用程序

位于"C:\ Program Files \ Microsoft Dynamics AX \ 60 \ BusinessConnector \ Bin \ AxCliCfg.exe"中.

Located in "C:\Program Files\Microsoft Dynamics AX\60\BusinessConnector\Bin\AxCliCfg.exe".

2.导入AXC文件

浏览到AXC文件并导入.

Browse to your AXC file and import it.

3.应用AXC文件

3. apply the AXC File

  • 切换到连接"标签.
  • 然后单击应用.
  • 然后单击刷新配置. WCF配置将重新生成.
  • 然后再次单击应用.

当然,这意味着您不能同时打开两个VS实例(例如,一个连接到生产环境,一个连接到开发环境).由于注册表中设置了连接属性,因此您只能使用一种配置.

Of course this means that you can not have two VS instances open at the same time (e.g. one connected to production and one to development). You are limited to one configuration, because of the connection properties set in the registry.

您仍然需要两个VS快捷键:

You still need two VS shortcuts:

  1. 一个带有AXC文件的VS快捷方式进行开发
  2. 一个带有AXC文件的VS快捷方式投入生产

如果要在环境之间切换,则需要执行步骤1至5.

If you want to switch between environment you need to follow step 1. to 5.