Friday, March 16, 2007

Running VisualStudio in the command line

It gave me pleasure to learn how to run the VisualStudio in the command line:
c:\devenv solutionfile.sln /build debug /project subproject
This can be helpful especially if I just want to build one project in a very big solution where it would take forever for VisualStudio to start up (especially with Resharper installed).

Thursday, March 15, 2007

Running an assembly from an intranet share

I needed this to be able to access an executable on a network share without opening up for executing all Intranet assemblies. The recommended way is to use the strong name for the assembly, this was surprisingly easy (this info can be had all over the internet):
  1. Create a key: sn -k mykey.snk
  2. Add "[assembly: AssemblyKeyFile("mykey.snk")]" to the AssemblyInfo.cs
  3. Compile :)
To allow this particular assembly to be loaded and run:
  1. Run ".NET Framework 2 Configuration" (to be found under Administrative Tools)
  2. Navigate to My Computer->Runtime Security Policy->Machine->Code Groups
  3. Right click on All_Code and select New and give it some name. Next
  4. Select "Strong Name" and click on Import
  5. Select the assembly/executable in question. Next
  6. Select FullTrust