Return Home

Using Visual Studio 2005 on Vista

posted by Eric Appel      38 Comments

I have been trying to do development on Vista since I went full time Vista at home during the release candidates.  Until recently it was nearly impossible to get any development done on this platform.  Due to some hard working people at Microsoft, developing on Vista is now a pleasure.  There are a couple of things you will need to do in addition to the normal Visual Studio 2005 install to be successful.

Install SP1 for Visual Studio 2005.  This download is quite large and took me over an hour to install.  Multi-tasking while installing this is not advised.  Also, be sure to uninstall the Web Applications Project add-on, otherwise you will get a half hour into the installation only to have it error out.

Install the Visual Studio 2005 SP1 Update for Windows Vista Beta.  This is the magic update that allows development on Vista to be a great experience.  Before installing this update, whenever I would do ASP.NET development on Vista, the controls that I added to the aspx pages would not automatically be declared in the designer.aspx file.  This made it so that I could not programmatically access any of the controls that I had declared in the aspx page.  Installing this update fixed the issue and it has not happened since.

Setup Visual Studio 2005 to always run as administrator.  Browse to your install dir (C:\Program Files\Microsoft Visual Studio 8\Common7\IDE) and open the properties for devenv.exe.  Switch to the compatibility tab and select "Run this program as an administrator". 

Read this post and setup the Debugging Assistant if you are on a development machine.  The post details some IIS configuration changes that need to be made as well as provides a link and instructions for setting up the debugging assistant. 

Before installing the debugging assistant I would get the following error message when trying to debug from Visual Studio...

Unable to start debugging on the web server. An authentication error occurred while communicating with the web server. Please see Help for assistance.

Mike's article talks about how this is most commonly due to event handlers in global.asax like BeginRequest; however, I did not have any event handlers in global.asax and I was still getting the error.  The most likely cause that I can think of is that I am using the ASP.NET AJAX Extensions (Atlas) RC1 and it is probably subscribing to pipeline notifications prior to AuthenticateRequest.  Setting up Mike's Debugging Assistant fixed the issue that I was having and I am now successfully able to debug.

For some other interesting articles on working with ASP.NET and Vista/IIS7 check out this post from Rick Strahl and this post from Scott Guthrie.

Thursday, January 04, 2007 3:01:15 PM (Pacific Standard Time, UTC-08:00)
I've been happily developing with Visual Studio 2005 under Windows XP as a non-admin user for the past 12 months. Setting up a program (in this case Visual Studio) to always run as Administrator is not and will never be an acceptable workaround/solution.
Thursday, January 04, 2007 3:35:07 PM (Pacific Standard Time, UTC-08:00)
You should send your feedback to the Visual Studio team if that is the way you feel. Due to changes in Vista's security model from XP, Visual Studio has to be run as admin. As of right now, even with the Vista update for Visual Studio installed, you have to run VS as an admin process to be able to debug. After installing the Vista update for Visual Studio, everytime you launch Visual Studio you will get a pop-up dialog stating that you should be running the process as administrator if you want things to work correctly. I am not sure if they will change this before the final release (I doubt it).
Friday, January 05, 2007 8:11:31 AM (Pacific Standard Time, UTC-08:00)
It is absolutely not necessary to run VS as admin all the time..!

Do you need that for developing WinForms or Console apps - of course not.

There are some occassions where admin privs are needed e.g.
debugging applications in different security contexts (e.g. a NT Service or ASP.NET),
registering COM objects or creating applications in IIS.

It IS recommended to develop/test your applications in the target security context -
and thats the message you should send!

Otherwise developers will develop apps as admins which also only run as admin
and in turn force their users to run as admin too. vicious circle

Tuesday, January 09, 2007 3:50:06 PM (Pacific Standard Time, UTC-08:00)
Who cares if you are running Visual Studio 2005 with Run as Administrator in Compatability mode, to my understanding of thow that works is it's not elevating your privileges its actually just falsifying your privileges because the app explicitly checks for your role and throws an exception if you arent an administrator. So the compatability mode simply tells VS your an admin even if you arent. I may be wrong but I believe thats how the compatability stuff works for vista.
Tuesday, January 30, 2007 3:07:52 PM (Pacific Standard Time, UTC-08:00)

I was just wondering if you knew if VS2005 can run on Vista Home edition. Planning on upgrading to the business edition later on.

Thanks, Jon
Jon Davidson
Thursday, February 01, 2007 12:08:34 PM (Pacific Standard Time, UTC-08:00)
Hey Jon. As far as I know VS2005 should run fine on Vista Home edition. Keep in mind though that Home Edition does not have IIS, so you will have to try to use VS2005's built-in web server.
Wednesday, February 14, 2007 12:34:15 PM (Pacific Standard Time, UTC-08:00)
MY problem has been that VS always crashes when I open up a remote website. I have VSS and FPSE. We have a couple of developers and we need to do it this way. I've heard some others are having the same problem. Did all the things you recommended....
Mark Lanio
Sunday, February 18, 2007 1:16:09 PM (Pacific Standard Time, UTC-08:00)
I have brought a new laptop and it's got Vista business on. Tried installing all the relevant upgrades for VS2005 express and SQL Server 2005 express to be "vista compatible" but hey no - it doesn't work. After running the website from VWD, the application graphics become corrupt and if trying to use a local sql server database, it tells me sqlservr.exe has stopped.

What more can you do? I've upgraded everything possible !!
Tuesday, February 20, 2007 10:38:14 PM (Pacific Standard Time, UTC-08:00)
@Mark - I haven't tried opening up a remote site via FPSE on Vista. Recently I've been using the built-in FTP features for publishing my sites.

@Jon - I have also had problems running sql server express on my Vista machine. Not sure what to do about that one.
Friday, February 23, 2007 9:53:05 AM (Pacific Standard Time, UTC-08:00)
i'm the visual studio 2005 on vista guinea pig in our dev group and i'm running into a problem that i can't get around. while debugging the debugger will just stop working, it won't detach from the process it just stops working. i lose my breakpoints and my position in the code, the IDE shows that i'm in debug (the pause button is selected) but i can't do anything in the code (F10, F11 or F5 won't work). i've been searching high and low for a solution to no avail, has anyone else heard of or experienced this issue. i'm using IIS7 and have gone though every configuration article/blog i can find.
Friday, March 02, 2007 5:54:08 AM (Pacific Standard Time, UTC-08:00)
I've got the same problem as Mark Lanio. If I try and open a remote website it blows up. :-(
Thursday, May 17, 2007 9:08:19 AM (Pacific Daylight Time, UTC-07:00)
Elevation is all it needed for debugging. Many thanks!
Monday, June 25, 2007 10:16:23 AM (Pacific Daylight Time, UTC-07:00)
Thank you for the Fix!!!! Your the only fix that works!!!
Monday, August 20, 2007 3:52:35 AM (Pacific Daylight Time, UTC-07:00)
i have plans to open a new software development company. can someone let me knoow wat would be the best hardware configuration as i wanna use visual studio 2005, Microsoft SQL Server platform for development.

is it better to use vista or xp. budjet is no constraint pls advice.
anup lama
Monday, August 20, 2007 3:54:44 AM (Pacific Daylight Time, UTC-07:00)
also will someone help as so as how to save information in database in visual studio, without coding much or some easy way... pls give in a simple example...
anup lama
Saturday, September 01, 2007 3:43:32 AM (Pacific Daylight Time, UTC-07:00)
I have a problem getting projects created in Visual Studio 2005 on XP machines to work in Visual Studio 2005 on a Vista machine. I have installed everything as instructed and tried running as Admin and in XP compatible mode.

The problem is that on build, I get errors indicating that all the controls on forms are not declared AND that I need a "withEvents variable" for button click subs.

If I create new projects from scratch in Visual Studio 2005 on the Vista machine the code comes out exactly as it does on the XP machine BUT there are no build errors. Button click subs created do not have a "withevents variable" but there is no error.

Any ideas? I feel like setting up my machine to dual boot Vista and XP and installing VS 2005 in XP.

Thanks for any help.
Thursday, September 06, 2007 2:48:30 AM (Pacific Daylight Time, UTC-07:00)
many many thanks to you! my problem is solved!
Saturday, November 17, 2007 6:12:56 AM (Pacific Standard Time, UTC-08:00)
I hope this helps....
Tuesday, February 12, 2008 5:07:48 AM (Pacific Standard Time, UTC-08:00)
hEy i iNstallEd Visual sTudio 2oo5 in my vISta window
and started d personal website in that
but when i run that
an error came sqlsrver.exe has stopped working nd whn i click on close of tht error box

den d page shows dis error

Server Error in '/WebSite2' Application.

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +219
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +49
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +160
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +67

[HttpException (0x80004005): Unable to connect to SQL Server database.]
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +123
System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +89
System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +26
System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +386

Please help me oUt
as i am not able to guess what is wrong ...........
Monday, March 17, 2008 2:11:03 PM (Pacific Standard Time, UTC-08:00)
Hi all,

I have Vista Premium and Visual Studio 2005 Installed with sp1 and vista update.

My problem is that after a successful build of the app and the setup. The app installs successfully into program files but when the app tries to update is throws an exception and says the app does not have permission to write to program files directory.

Something to do with vistas security.

Does anyone know how i can get my app to be able to write to program files dir.

Wednesday, March 26, 2008 12:50:24 PM (Pacific Standard Time, UTC-08:00)
i'll upgrade my computer to be able to use vista+vs 2005 . Thanks for this great article.
Monday, April 14, 2008 8:09:08 PM (Pacific Daylight Time, UTC-07:00)
thanks a lot..
Tuesday, May 06, 2008 6:45:35 AM (Pacific Daylight Time, UTC-07:00)
I had other issues with Vista SP1, VS 2005 and IIS 7 and I have written a post here
Sunday, January 26, 2014 3:11:03 AM (Pacific Standard Time, UTC-08:00)
Hi, I'm really impressed with your writing skills and also with the layout on
your weblog. Is this a custom theme or did you customize it yourself ?

Anyway keep up the excellent quality writing, it is rare to see
a great blog like this one these days.. Thanks a lot!
Tuesday, February 11, 2014 6:37:40 PM (Pacific Standard Time, UTC-08:00)
I'm not sure exactly why but this site is loading incredibly slow for me.
Is anyone else having this problem or is it a issue on my end?
I'll check back later and see if the problem still exists.

Also visit my website - reiki healer
Wednesday, March 12, 2014 12:36:54 AM (Pacific Standard Time, UTC-08:00)
Most other reverse look ups force one to pay to get a name.
At the very top in the screen find and click for the "tools tab".
The data on the Travian World Analyzer is updated daily,
thus, making this website an extremely useful tool.
Wednesday, March 12, 2014 7:30:16 PM (Pacific Standard Time, UTC-08:00)
You really make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand.
It seems too complex and extremely broad for me. I am looking forward for
your next post, I will try to get the hang of it!
Thursday, March 13, 2014 6:59:00 PM (Pacific Standard Time, UTC-08:00)
I am regular visitor, how are you everybody?
This piece of writing posted at this site is actually good.
Thursday, March 13, 2014 8:34:25 PM (Pacific Standard Time, UTC-08:00)
Hey I know this is off topic but I was wondering if you knew of any widgets I
could add to my blog that automatically tweet my newest twitter updates.

I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like
this. Please let me know if you run into anything.

I truly enjoy reading your blog and I look
forward to your new updates.
Saturday, March 29, 2014 5:19:06 AM (Pacific Standard Time, UTC-08:00)
Wednesday, April 02, 2014 3:42:22 PM (Pacific Standard Time, UTC-08:00)
Mega red krill oil has lots of benefits for our health
and it is most probably the answer that we are looking for.
You will be surprised to know that there are no side effects
of krill oil or perch supplement. Here's some great foods
that contain 'healthy fats' that you can incorporate into your diet.

Check out my blog - krill oil wholesale
Wednesday, April 09, 2014 6:43:04 AM (Pacific Daylight Time, UTC-07:00)
I have been exploring for a little bit for any high quality articles or blog posts in this sort of
area . Exploring in Yahoo I ultimately stumbled upon this site.
Reading this info So i'm satisfied to convey that
I've a very good uncanny feeling I found out just what I needed.

I such a lot surely will make sure to do
not overlook this website and provides it a glance on a relentless basis.
Friday, April 11, 2014 7:00:23 PM (Pacific Daylight Time, UTC-07:00)
The maintenance free batter operated fan operates at two
speeds and clips anywhere. Recent times have noticed a massive increase the realm of computerized thermostats,
nest looks to turn bradenton surrounding. The devices must be hooked to a power source and be connected
to WI-FI for it to automatically back up.
Friday, April 18, 2014 3:57:57 AM (Pacific Daylight Time, UTC-07:00)
For example, when opening a brand new store, there will be
no existing wholesale parts business, retail sales base; yellow page advertising; or vehicles lined up for service the day after the escrow closes.

Music systems, car logos and in worse cases the entire car is stolen
within a few minutes. The most important thing regarding buying
a used car for sale in Quebec is that making business with a
dealer is safer because you have more legal recourse in case of problems.
Saturday, April 19, 2014 2:08:35 PM (Pacific Daylight Time, UTC-07:00)
Thank you a bunch for sharing this with all folks you really realize what you're speaking about!

Bookmarked. Kindly additionally discuss with my web site
=). We could have a link exchange contract among us
Saturday, April 19, 2014 3:01:19 PM (Pacific Daylight Time, UTC-07:00)
Your own data afterward ideas extraordinarily near in my opinion.
Thank you very significantly before hand. Your current facts for this subject is fantastic,
I'm glad that will the following is recovered. Thanks another time!
Saturday, April 19, 2014 5:57:04 PM (Pacific Daylight Time, UTC-07:00)
Hi, Neat post. There's a problem with your website in internet explorer, might check this?
IE still is the marketplace chief and a huge component to folks will
leave out your fantastic writing because of this problem.
Monday, April 21, 2014 11:10:41 PM (Pacific Daylight Time, UTC-07:00)
Great items from you, man. I have take into account
your stuff previous to and you are just extremely excellent.

I actually like what you've obtained right here, certainly like what you're saying
and the best way wherein you say it. You make it entertaining
and you still care for to keep it sensible. I can't wait to learn
much more from you. This is actually a great site.
Please login with either your OpenID above, or your details below.
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview