The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.
Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Monday, March 14, 2011

Powershell script to generate a TODO report

You can use this from your CI build process, help keep the code base clean. I am a big fan of the TODO: comment, but you don't want too many building up in the code base at some point you either need 'TO DO IT' or else forget about it.




the above script is excluding all files found under lib or Test directories, and selecting only a subset of file types. Modify to your needs

Friday, March 11, 2011

MSTest output result to HTML

MSTest generates trx (xml) files which can be viewed in Visual Studio. But often you will be executing MSTest from the command line via your Continuous Integration (CI) server and you will want to view them in an html format outside Visual Studio.

trx2html to the rescue!

  • download the zip file here - http://trx2html.codeplex.com/
  • unzip and put the files somewhere
    • I choose C:\Program Files (x86)\trx2html
  • execute it from the command line 

# in YourTestProject\bin\Release
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:YourTestProject.dll /resultsfile:TestResult.trx

"C:\Program Files (x86)\trx2html\0.6\trx2html.exe" TestResult.trx
# outputs TestResult.trx.htm


Wednesday, March 9, 2011

Visual Studio Solution Items in a sub directory

Visual Studio Solutions have the "Add New Solution Folder" option.



I don't know about you but this makes me think it is going to create a physical directory on the hard drive to emulate what is in the solution, but this is not the case.



The thing that really drives me crazy is if you try to add Test1.txt to the SubFolder it will throw an error because it is really trying to write to the root directory. I think solution folders are only really supposed to be used to organize Visual Studio projects.

In my case I want to have a set of files that are not really part of a Visual Studio project but I want them available in the solution. It turns out there is a Project type called "Empty Project".


This is exactly what the doctor ordered!

You will probably want to do one additional step. Set this "Empty Project" to not build, otherwise you will get a compile time error. Right click on the Solution > Properties > Configuration Properties > Configuration, then un-check the "Build" for this project.

Found out about this from this stackoverflow post.

Here is a good link explaining what you would use a solution folder for, besides a ReadMe.txt