Friday, November 8, 2013

The ASP.Net MVC 3 installer fails when you have a newer version of NuGet installed - WORKAROUND

I tried to install MVC3 for VS2010 but got error during the instalation:

MSI (s) (DC:18) [11:11:41:990]: Note: 1: 1325 2: VSIXInstaller.exe
MSI (s) (DC:18) [11:11:41:990]: Doing action: LaunchConditions
Action ended 11:11:41: AppSearch. Return value 1.
Action start 11:11:42: LaunchConditions.
MSI (s) (DC:18) [11:11:42:022]: Note: 1: 2205 2: 3: Error
MSI (s) (DC:18) [11:11:42:022]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (DC:18) [11:11:42:022]: Product: NuGet -- A later version of NuGet is already installed. Setup will now exit.


I had newer NuGet and the installer tried to install v.1.5.

Work around
  • Run the install (even though it fails) but leave it open on the screen at the end that says "Installation Did Not Succeed" (This is very important!)
  • Now you need to track down the temp files for the installer it should be in a folder {drive}:/Temp/ext27692 (probably this goes onto whatever drive has the most free space)
  • Make a copy of this entire folder because finishing the installer will delete it.
  • Now that you have all the install files you just need to run the installers for the different components (to double check what they were you can open the log from the installer and see which msi's it ran)
So install AspNetWebPagesVS2010Tools.msi then AspNetMVC3VS2010Tools.msi

ASP.NET MVC3 tools are now installed!

Monday, July 1, 2013

Database stuck in single user mode

If you are getting error messages like this:

Msg 5064, Level 16, State 1, Line 1
Changes to the state or options of database 'DbName' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

the only thing will help you:

Get process id of active db connection using script:

select * from master.sys.sysprocesses
where spid>50 -- don't want system sessions
and dbid = DB_ID('DbName')


In my case I got 52.

And then execute:

use master
kill 52-- the connection to the database in single user mode
use [DbName]
alter database [DbName] set multi_user with rollback immediate


Or:

use master
kill 52-- the connection to the database in single user mode
alter database [DbName] set offline with rollback immediate
alter database [DbName] set online, multi_user with rollback immediate


Hope this will help you.