Microsoft Robotics Studio和绝对路径问题

发布于 08-03 19:59 字数 472 浏览 7 评论 0原文

我刚刚安装了 Microsoft Robotics Studio 2008 R2,我必须承认我对路径的处理方式感到震惊。

首先,工作室想要将自己安装到我的个人配置文件中(这是在 Vista 上):

C:\Users\MyUserName\Microsoft Robotics Dev Studio 2008 R2

我认为这是因为在开发过程中我必须将文件写入机器人工作室文件夹,使 C:\Program Files不行。

然后,当我创建一个新的机器人项目时,许多指向机器人工作室的绝对路径被添加到该项目中。如果我将我的项目签入源代码管理,而另一个开发人员将其签出到他的计算机上,则绝对路径将无法解析,并且项目将无法编译。

此外,由于所有服务都收集到机器人工作室文件夹中的单个文件夹中,因此在一台计算机上开发多个独立服务似乎至少会令人困惑。

你有什么好的策略来处理这个混乱吗?

I have just installed Microsoft Robotics Studio 2008 R2, and I must admit that I'm shocked to discover how paths are handled.

First of the studio wants to install itself into my personal profile (this is on Vista):

C:\Users\MyUserName\Microsoft Robotics Dev Studio 2008 R2

I assume this is because during development I have to write files to the robotics studio folder making C:\Program Files a no go.

Then when I create a new robotics project a lot of absolute paths pointing to the robotics studio is added to the project. If I check my project into source control and another developer checks it out onto his machine the absolute paths will not resolve and the project will not compile.

Also, since all services are collected into a single folder in the robotics studio folder developing multiple independent services on a single computer appears to be at least confusing.

Do you have any good strategies for handling this mess?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岁月染过的梦2024-08-10 19:59:16

我现在找到了一种方法,可以将 Microsoft Robotics DSS Service 视觉工作室项目更改为可以在自己的源代码树中编译和运行的项目,而与机器人工作室的安装路径无关。以下是修改项目所需执行的操作的描述:

  1. 将 robots studio bin 路径添加到 PATH 环境变量中,以便能够执行 dssproxy.exe 不提供完整路径。我已将 robots studio 安装到了程序文件文件夹中,以避免意外将文件写入 robots studio 文件夹。

  2. 打开项目的属性页面,然后选择构建选项卡。在输出部分中,将输出路径更改为Debug\bin。对于 .NET 项目,通常会编译到文件夹 bin\Debugbin\Release 中,但机器人托管服务期望位于文件夹中名为 bin 并将数据存储在 bin 文件夹上方的文件夹中。

  3. 转到签名选项卡,然后在选择强名称密钥文件框中选择一个新密钥。您可以在此时生成自己的密钥,也可以使用 sn.exe 实用程序生成新密钥。或者,如果您有自己的创建密钥的策略,请遵循该策略。 sn.exe 实用程序可以在 robots studio 的 tools 文件夹中找到。

  4. 构建事件选项卡中编辑构建后事件命令行

    dssproxy.exe /dll:"$(TargetPath)" /proxyprojectpath:"$(ProjectDir)Proxy" /keyfile:"$(SolutionDir)Key.snk" $(ProxyDelaySign) $(CompactFrameworkProxyGen) /binpath :“。” @(ReferencePath->'/referencepath:"%(RootDir)%(Directory)"', ' ')

    注意/keyfile的参数。输入一个表达式,用于定位在上一步中创建的强名称密钥文件。

  5. 复制文件 DssHost.exeDssHost.exe.config(或 DssHost32.config)。 exeDssHost32.exe.config(用于 32 位托管服务))从 robots studio bin 文件夹复制到项目文件夹中,并将这些文件添加到项目中。将构建操作设置为内容,将复制到输出目录设置为如果较新则复制。对您的服务的清单文件执行相同的操作。实际上,清单文件不必与服务位于同一文件夹中,但将其复制到输出文件夹可以让您执行 XCOPY 部署。

  6. 调试选项卡中,将启动外部程序更改为输出文件夹中的DssHost.exe你的项目。您必须构建项目一次才能将文件复制到输出文件夹。清除工作目录。将命令行参数设置为

    /p:50000 /t:50001 /m:DSSService1.manifest.xml

    将清单文件名更改为项目中的正确名称。您可以修改此处或 DssHost.exe.config 文件中使用的端口号。如果您在受保护的 Windows 环境 (UAC) 中运行,则必须使用 httpreserve 命令来授予自己对特定端口的访问权限。您必须以管理员身份运行此命令。

    调试设置不会存储在项目文件中,每个开发人员都必须创建个人设置。

您还应该相应地更新发布配置。

I have now figured out a way to change a Microsoft Robotics DSS Service visual studio project into something that you can compile and run in you own source tree independent of the installation path of the robotics studio. Here is a description of what you need to do to modify the project:

  1. Add the robotics studio bin path to you PATH environment variable to be able to execute dssproxy.exe without supplying a full path. I have installed robotics studio into the program files folder to avoid accidentially writing files to the robotics studio folders.

  2. Open the Properties page for the project and select the Build tab. In the Output section change the Output path to Debug\bin. For .NET projects it is customary to compile into folders bin\Debug and bin\Release but the robotics hosting service expects to live in a folder named bin and will store data in the folder above the bin folder.

  3. Go to the Signing tab and select a new key in the Choose a strong name key file box. You can either generate your own key at that point or use the sn.exe utility to generate a new key. Or if you have your own policy for creating keys follow that. The sn.exe utility can be found in the tools folder of robotics studio.

  4. In the Build Events tab edit Post-build event command line:

    dssproxy.exe /dll:"$(TargetPath)" /proxyprojectpath:"$(ProjectDir)Proxy" /keyfile:"$(SolutionDir)Key.snk" $(ProxyDelaySign) $(CompactFrameworkProxyGen) /binpath:"." @(ReferencePath->'/referencepath:"%(RootDir)%(Directory) "', ' ')

    Pay attention to the argument to /keyfile. Enter an expression that locates the strong name key file created in the previous step.

  5. Copy the files DssHost.exe and DssHost.exe.config (or DssHost32.exe and DssHost32.exe.config for the 32 bit hosting service) from the robotics studio bin folder into the project folder and add these files to the project. Set the Build Action to Content and Copy to Output Directory to Copy if newer. Do the same for the manifest file for your service. Actually, the manifest file doesn't have to be in the same folder as the service, but copying it to the output folder enables you to do XCOPY deployment.

  6. In the Debug tab change the Start external program to the DssHost.exe in the output folder of your project. You will have to build the project once to copy the file to the output folder. Clear the Working directory. Set the Command line arguments to

    /p:50000 /t:50001 /m:DSSService1.manifest.xml

    Change the manifest file name to the proper name in your project. You can modify the port numbers used either here or in the DssHost.exe.config file. If you are running in a protected Windows environment (UAC) you will have to use the httpreserve command to give yourself access to a particular port. You have to run this command as administrator.

    Debug settings are not stored in the project file and each developer will have to create personal settings.

You should also update the Release configuration accordingly.

青春有你2024-08-10 19:59:16

由于我只对 MS Robotics 的 CCR 感兴趣,因此我只需添加这些程序集作为我使用它的任何项目的参考,然后就可以完成它。

这工作没有任何问题。因此,如果您也只对工作室的 CCR 和 DSS 部分感兴趣,那么这可能是您的解决方案

Reinier

Since I was only interested in the CCR of MS Robotics, I just add these assemblies as a reference to any project I use it with and just be done with it.

This works without any problems. So if you are also only interested in the CCR and DSS part of the studio then this could be your solution

Reinier

独﹏钓一江月2024-08-10 19:59:16

我们经常看到这个问题。最简单的解决方案是在安装 robots studio 时将安装目录指定为“C:\program files\microsoft robots studio”。这样,在机器之间移动代码、检出源代码控制等问题就会少很多。

另一个选项是使用 dssprojectmigration,它包含在 RDS 中。只需针对您的项目目录运行 dssprojectmigration,它将更正所有硬编码路径。

we see this problem a lot. The absolute easiest solution is to specify the install directory when installing robotics studio to be "C:\program files\microsoft robotics studio". That way moving code between machines, checking out of source control, etc becomes a lot less problematic.

The other option is to use dssprojectmigration, which is included with RDS. Just run dssprojectmigration against your project directory, and it will correct all the hardcoded paths.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文