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?
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:
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.
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.
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.
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.
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.
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.
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
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.
Related
We're trying to maintain a single set of Visual Studio Code extensions within our organisation, managed centrally. In our ideal scenario all end users have the same extensions installed, those extensions are updated on their behalf, and they are not able to install additional extensions.
We had achieved this to date by:
Installing extensions to a directory under C:\Program Files and setting the (undocumented) VSCODE_EXTENSIONS environment variable to point to that location.
Configuring a scheduled task (run as SYSTEM) that executes a powershell script with a list of extension_ids that calls code install-extension <extension_id> on each.
This solution worked until a breaking change in v1.74 expected to be able to write a new extensions.json file to the extensions directory.
Whilst we can get around this by creating a extensions.json file in that directory, I don't want to go too far down the wrong path. Is there a preferred method for centrally managing extensions for Visual Studio Code?
I looked up to see if some post already had the answer but I have a situation in VSCode that is easy to resolve in Visual Studio but here I don't know how to do it.
I have a project that runs in a virtual director of other Site.
Lets say I run http://example.com and than in the iis I have a Virtual Directory named "Tests" that holds my project. So in production env I type http://example.com/Tests and I can see my site and all the relative paths that I have (on assets mainly) work.
The thing is that I want to stop using Visual Studio and start using VSCODE and I don t know how to configure the project so when I ask for asset with the relative path "/Tests/main.css" the right file is served (because of the folder Tests not really existing).
I installed iisexpress in vscode and tried to configure it but with no luck.
Sorry for possibly the bad explanation.
Thanks for your time and help.
If I publish with my website with Visual Studio (using FileSystem) it works fine.
Now I'm attempting to do the same from Powershell.
.\MSBuild.exe $sln /p:PublishProfile=MyTestProfile /p:PublishProvider=FileSystem /p:CreatePackageOnPublish=False /p:DeployOnBuild=False /p:VisualStudioVersion=15.0 /v:diag
The above is based upon the output window (of Visual Studio) when I publish (using diagnostic output). Things are copied and pasted to avoid typos.
The problem I have is it never publishes!
I am now shown the following message from Powershell:
Build FAILED.
"C:\Users\me\source\repos\Test03\WebApplication2\WebApplication2.csproj" (default target) (1) ->
C:\Users\me\source\repos\Test03\WebApplication2\WebApplication2.csproj(265,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
This issue appears to be well documented here on SO but, I already have VS installed, and this isn't a build server. It's all being done on my one machine... However, if I try to get to the path C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets it doesn't exist. I have C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\ but within this folder only 1 folder called FileTracker.
This now confuses me more because it works from within Visual Studio, but not within Powershell.
Resolved with
.\MSBuild.exe $sln /p:PublishProfile=MyTestProfile /p:PublishProvider=FileSystem /p:CreatePackageOnPublish=False /p:DeployOnBuild=True /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools" /p:VisualStudioVersion=15.0 #/v:diag
You may not have the path for the correct visual studio version. Downloading .NET Core SDK should provide this https://www.microsoft.com/net/download/windows
However, you may need to update to the correct path for the build path (where msbuild.exe exists).
I then had to add /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools" manually for reasons I don't understand. I understand that it coudln't find this path, but I didn't understand why it can't find the path when VS could!
I'm programming a client side applications using SharePoint Designer 2013.
I want to change to VSCODE since it supports a lot of extensions for some Javascript library like angular, jQuery. And because of the Chrome/Node.js debugger extension.
But when I try to start any Debugger, I got the error:
Unable to create 'launch.json' file inside the '.vscode' folder (Error: UNKNOWN: unknown error, mkdir '\\servername\DavWWWRoot\sitename\Style Library\.vscode').
I get this error because it's impossible to create a folder in SharePoint where the name starts with dot.
So there's a possibility to change the name of this folder or the file location to any directory in my local computer?
No, it's not possible to move/rename that folder. VS code is a tool that bases project management on folder content. So it is essential that the project settings reside in the folder being managed.
You can move the "extensions" folder, but unfortunately not the argv.json (so the ".vscode" will, at least be recreated on vscode launch)
https://github.com/microsoft/vscode/issues/17691#issuecomment-559234574
I hope that'll finally change sometime .
https://github.com/microsoft/vscode/issues/3884
https://github.com/OmniSharp/omnisharp-roslyn/issues/953
I ran Protobuild.exe, but no one has mentioned where it outputs to. Does anyone here know where the default folder is suppose to be at?
Running Protobuild.exe generates the Visual Studio projects and solutions for every platform. The solutions are in the root directory, i.e. along Protobuild.exe.
Note that Protobuild does not build the framework - you have to open the solution and build it in Visual Studio (which generates its output in MonoGame.Framework\bin subdirectory).