Sunday, April 15, 2012

SqlExpress - enable sa login

For some reason, I like to have ability to login with both windows and integrated authentication. Although, installing SqlExpress by default gives you only the second option. And naturally, some of us do not have Management Studio installed just here and now :)
It has been written enough about this already, so this is just a summary:

 1. Go to registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQLServer (in my case SqlExpress was installed by TFS 11,otherwise look for smth like MSSQL.x under Microsoft Sql Server) and set LoginMode to 2.

2. Start sqlcmd using integrated authentication:
sqlcmd .\SQLEXPRESS -E
ALTER LOGIN sa with password='your_sa_password'

3. Restart you SQL server instance, so it picks up changes you made in registry.

Now you can login with sa user, for example:
sqlcmd .\SQLEXPRESS -U sa -P your_sa_password

Friday, April 13, 2012

TFS build + Code analysis : no result files in Binaries?

I configured to run Code Analysis during build, and for one solution all of CodeAnalysisLog files were successfully collected at Binaries directory. But for another .... they were not there.

So at first - checked that code analysis was performed - yes log says so. I went to Source directory at build agent - and here they were all together, my result files. But I still wanted them in Binaries folder, which actually is a normal default place for them to be.

So I compared .proj files from the first solution and the second - and there it was:


Removing that line allowed MSBuild to put files where it wanted - in Binaries folder.

Sunday, April 1, 2012

Wix + TFS : problem with building on x64 build agents

I ran into interesting problem recently, trying to build wix custom action project on our build agent (simple wix project had no problem).
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. Could not locate the assembly "Microsoft.Deployment.WindowsInstaller". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
The worst part was that when I logged in to the machine and built same stuff from visual studio – it worked as a charm.
So, after some investigation, I found that on x64 machines Wix installer writes its information only under wow6432Node. And naturally, x64 MSBuild process can’t find them.

Solution 1:
Add new string  as HKLM\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\WiX 3.5 with value set to C:\Program Files (x86)\Windows Installer XML v3.5\SDK\(same as under Wow6432Node - HKLM\SOFTWARE\Wow6432Node\Microsoft\.NET
Framework\AssemblyFolders\WiX 3.5)

Solution 2: 
(which turned to be much easier) choose to run MSBuild on x86 (when edit build definition)

Hope that helps somebody :)