3

I'm trying to run the standard ASP.NET MVC 4 Single Page Application, but when I try to run it (Ctrl + F5), I get the following error message:

Unable to launch the IIS Express Web server.

21:45:25 Error: Cannot Initialize OLE

21:45:25 Error: Cannot Initialize OLE

I encountered a similar error around a year ago, I solved it then by adding an [STAThread()] before the Main application method. But that was a standalone application, and I don't think I can find a matching method in an entire SPA project - I've tried adding the attribute before the Application_Start() method in Global.asax.cs but I've been unsuccessful.

Google has absolutely failed me (many of the results when googling "Cannot Initialize OLE" are questions that I asked a year ago on a few Q&A sites, trying to find a solution for the problem) and I believe that this problem is perhaps unique to my machine and my configuration, but I don't have the experience to experiment with it.

I'd appreciate any help.

Some potentially relevant information: I'm running Visual Studio 2012 and ASP.NET MVC 4.

Community
  • 1
  • 1
Daniel
  • 2,944
  • 3
  • 22
  • 40
  • If you want help, you should give us more information. Show us your global.asax, web.config with connection string and code that takes data from db. – Kirill Bestemyanov Jun 10 '13 at 19:54
  • Could try the suggestion [here](http://stackoverflow.com/a/6177157/119246). – Darth Continent Jun 10 '13 at 21:06
  • @KirillBestemyanov I've opened an absolutely standard web project with nothing more than an empty HTML file, and tried to run the project, and it still shows the same error. So the problem is not in the global.asax/connection string, as the site lacks both of them. [Here is the web.config file](http://pastebin.com/ffVHwx0q) – Daniel Jun 10 '13 at 22:44
  • @DarthContinent I've followed the answer's suggestions and none have worked - I haven't reinstalled Visual Studio and I'd rather not do that unless no other solution is found. – Daniel Jun 10 '13 at 22:45
  • look at this:http://stackoverflow.com/questions/13167326/vs-2012-iis-express-8-unable-to-launch-the-iis-express-web-server there is a solution, try it. – Kirill Bestemyanov Jun 11 '13 at 05:07
  • Maybe you could try to run IISExpress manually with the trace flags set to the maximum level (http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line). Also, have you tried IIS (not express)? And do you have upgraded VS 2012 to Update 2? – Simon Mourier Jun 11 '13 at 07:41
  • OK over the weekend I uninstalled virtually every Microsoft program I had on my computer (Visual Studio 2008, 2010, 2012, IIS, SQL Server 2008/2012, .NET Framework, more) for some reason the SQL Server 2008 Import/Export Data and Configuration Tools didn't uninstall but the rest did. I restarted my computer, reinstalled Visual Studio (2012), also installed Update 2, and then ran the project again - only to encounter the same error. The problem is almost certainly with my configuration, I've tried following the solution that @KirillBestemyanov provided but it did not help. – Daniel Jun 16 '13 at 12:56
  • Agree with @Kirill Bestemyanov, this sounds like more an environment issue. How was your .Netframework installed? And your Visual Studio 2012 set up? Can you change to another machine and try this again? Hope helps – Herbert Yu Jun 15 '13 at 01:21

1 Answers1

1

Not sure if this really counts as an answer, but reinstalling Windows fixed the problem for me.

Daniel
  • 2,944
  • 3
  • 22
  • 40