Thursday, May 10, 2012

TFS Build: Unable to read Code Analysis output report. Make sure that the directory is writable (default is the project output directory)

Yes, the problem is  CodeAnalysisLogFile setting in your .proj file. 
Yes, removing this setting will fix your build.

Going back to my previous post, which is related to the same setting http://il-adan.blogspot.com/2012/04/tfs-build-code-analysis-no-result-files.html, I did some more to figure out HOW actually this settings ruins it all.

If CodeAnalysisLogFile  tag is set in project file, when code analysis is called - it sends in parameter /out. For example, see in .proj file:



That means  code analysis run wil get such parameter as /out:"bin\Debug\TestApp.dll.CodeAnalysisLog.xml". And it is a RELATIVE path from the place where FxCorp is run from. In case of TFS build, FxCorp is run from project file location. But as we remember, TFS build outputs files to $Binaries$ folder, not to $Project_location$\bin\Debug, so, since $Project_location$\bin\Debug doesn't exists - BANG!

Btw, if you want to avoid this nasty setting to appear in your porject files, when create new building configuration select Copy settings from <Empty>, this will keep your .proj file clean.

 


For those projects which already have this setting, I created a build activity which parses project files and remove this setting. Works as charm.

Wednesday, May 9, 2012

What to write as a check-in comment

This is just a geeks-fun post :)
See what people write as a check-in comment:

http://whatthecommit.com/

This made my day!

Monday, May 7, 2012

Is your Visual Studio 2010 up-to-date?

Have you installed all the latest patches and updates for your Visual Studio 2010? Probably you do not know the answer, as many of us don't.
A very nice solution is out there now, which helps you being up-to-date with minimal effort!


Hope you enjoy it as much as I did :)

Friday, May 4, 2012

TFS build: TF277000: Cannot add process template with duplicate server path

Ever seen something like that?


 
And then you go, and create a copy of existing template with another name, just to be able to use it?
Easy :)
When creating a build definition, if you already have a template and probably used it before - do not click New button, just click on combo-box and you will find it there!

TFS build: disable a build definition

It is easy and obvious, yet, when I googled it, I was unable to find the answer fast. So I had to ask a clever colleague for the help.
Disabling build definition freezes it, so no new builds can be queued. Yet it is not deleted, so all information persists, and build definition can be unfrozen in a future.

It is really easy, just when you know where to look. Select Edit build definition, on a General tab, just in the bottom, there is a checkbox "Disable this build defintion" (you might need to scroll down to be able to see it):


Wix: where is my web application created?

Installing a web application, I want to select on wich web site it suppose to be created.
So, I let's say I have 2 web sites:

Default Web Site listening on *:80
Test Web Site listening on *:8080

In my wix code I write smth like that:

<iis:WebSite Id='SelectedWebSite'
                 Description='[WEBSITE_NAME]'
                 Directory='INSTALLDIR'>
      <iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>

AND I put this under Product, since I am not interested in my web site being created on install and removed on uninstall, i.e. I ask user to choose from existing web sites (details see here: http://wix.sourceforge.net/manual-wix3/iis_xsd_website.htm)

So far so good. Moving on - to virtual dir and web application itself.
Under dedicated component  write this:
     
 <iis:WebVirtualDir Id="VDir"
                                Alias="[WEB_APP_NAME]"
                                Directory="INSTALLDIR"
                                WebSite="SelectedWebSite">
           <iis:WebApplication Id="MyWebAppApplication"
                                             WebAppPool="SelectedAppPool"
                                             Name="[WEB_APP_NAME]" />
           <iis:WebDirProperties Id="SelectedWebSite_Properties"
                                                AnonymousAccess="yes" 
                                                WindowsAuthentication="no"
                                                DefaultDocuments="Default.aspx" />
</iis:WebVirtualDir>              
                        
So I start installation and select Test Web Site to install under. What do I expect? Virtual directory and web application being created under selected web site.
But hold on, it is not that easy!

In that case, virtual directory is located under the right place, but web application ended up under Default Web Site. Why is that? Becouse it is Default Web Site listening to *:80, and that(*:80) is specified in iis:WebAddress part under iis:WebSite.
Just to make sure, I changed  to <iis:WebAddress Id="AllUnassigned" Port="8080"/> - and vuala, this time my web application ended up under correct Test Web Site.

Interesting...