tangercp

Archive for December, 2008

SQL Server Express auto-creation Login failed for user in Visual Studio

In Software Development on December 17, 2008 at 1:41 am

Have you received the following error:

Login failed for user ‘Domain\Username’.

SQLExpress database file auto-creation error

In Visual Studio 2005 or 2008 when trying to run a web site that auto-creates an ASP.NET database.  Or perhaps you’ve gotten the error when simply right clicking on App_Data and trying to add a new SQL Server database usually named ASPNETDB.MDF?

After wasting a day of my time verifying things such as:

Does my windows username have dbcreate access in SQL Express?

Does my global web.config or machine.config have something wrong in the connectionStrings section? Perhaps LocalSqlServer got misconfigured in the past.

In the end I discovered that the reason was Vista’s user account control.  I simply needed to to right click on my Visual Studio icon and select “Run as Administrator”, then everything worked and the error went away.

This is why it might work fine if you are running the ASP.NET web application in IIS, but not when running under a DB admin authorized windows administrator account in Visual Studio.

Another tip:  If you are having any sort of strange error or problem in Visual Studio or with running sites, just exit Visual Studio and run it again as administrator.

.NET Framework should be pushed via Windows Update

In Uncategorized on December 2, 2008 at 3:26 am

Many developers have been clamoring for an automatic push of the .NET framework to windows computers that don’t already have it via Windows Update or Microsoft Update.  It has been absolutely crippling to developers trying to write and deliver small pieces of software over the internet.  Even with broadband the install takes 5 minutes on a PC assuming it doesn’t have anti-virus software, spyware, etc. slowing it down.

Clients balk at software developed in the .NET framework they have a 20M install size instead of 2M, +5 minutes install time, and about 3 additional dialogs during install.

Even with broadband, assuming 768K DSL the download time for 20M is an additional 3.5 minutes which doesn’t sound bad until you consider that it might have taken 20 seconds.  Imagine a user kicking off the download from say download.com then going on to browse the news or worse yet downloading competing software, leaving your software’s download forgotten in the background.

Also, what about “click once” deployment and all the other possibilities that might have been.

Not pushing the .NET Framework out via Windows Update seems to be a big misstep on Microsoft’s part and it is killing developers who choose to devote themselves to .NET dev only.

I find writing software in unmanaged C++ or other non .NET languages increases time to market, development cost, and is much more tedious.

At least Microsoft is moving in the right direction with Vista by including the .NET Framework 2.0 out of the box and pushing newer versions of .NET instead of just service packs for already installed versions.  See Scott Hanselman’s computerzen.com article on this.

Ray Ozzie should get this little problem fixed as part of the improvements he is trying to implement at Microsoft.

I’ve learned since writing the above that there are legal issues mostly related to the EU (European Union) anti-trust laws that have prevented Microsoft from pushing .NET out.  I’m not so sure all this consumer protection actually protects consumers that much when it makes it a pain for them to run apps written at a much lower cost in .NET.