Unable to Start Lightswitch Server with HTML Client (VS 2012 Update 2) RRS feed

  • Question

  • I am working through the Contoso Movers sample app and I encounter the error "Unable to connect to Lightswitch Server" when trying to run the project.  It worked fine before I added the HTML client and upgraded the project.  I did not have preview 2 installed.

    Thanks for your help.

    Monday, April 22, 2013 8:45 PM


  • I am posting a solution that worked for me in case anybody winds up here with the same problem:

    1. Uninstall VS 2012
    2. Uninstall WebMatrix 3
    3. Uninstall IIS 8 Express
    4. Reinstall VS 2012 Update 2
    5. Repair .NET Framework 4.5 (I would try this first since things started working after I did this)
    6. Reinstall WebMatrix 3 
    • Marked as answer by GerryW4 Thursday, May 9, 2013 4:15 PM
    Thursday, May 9, 2013 4:15 PM

All replies

  • Same problem here. Standard Lightswitch projects run just fine. On my side, there is no AV which will prevent the Server to run.

    Any ideas?

    Tuesday, April 23, 2013 7:39 AM
  • I was able to get my Lightswitch project working. My problem was related to my IISEXPRESS installation. For every user there should be a "config" directory under %USERPATH%\Documents\IISEXPRESS. This config directory  has a file called "applicationhost.config". On my side, running IISEXPRESS based on this config file results in an error. I cleaned up this file an removed some nodes which refers to "iisnode". After saving this file, i was able to run my lightswitch Project (Restart VS).

    It should be save to replace a corrupted config file with a file from another account, where Lightswitch Projects run fine.

    Hope this helps.

    Wednesday, April 24, 2013 9:19 AM
  • Thanks for the update.  I looked ant my application.config file and it doesn't contain "iisnode".  I repaired IISExpress and that didn't help.

    I tried creating a new HTML5 application from scratch and I still get the "Unable to connect to Lightswitch server" error message.

    I'm still looking for a solution and would appreciate help from anyone.  Thanks.

    Friday, April 26, 2013 2:42 PM
  • Hi,

    I agree that IIS Express is most likely the issue here. I noticed that I can delete the whole My Documents\IISExpress folder (C:\Users\UserName\Documents\IISExpress on Windows 8), and IIS Express will regenerate the folder.

    Can you try this and see if it's really IIS Express issue:

    1. Delete My Documents\IISExpress folder.
    2. Start Visual Studio, create a Visual Basic (or Visual C#) | Web | ASP.NET Empty Web Application.
    3. Add New Item | Web | HTML Page.
    4. F5.

    VS should start a new instance of IIS Express and show the HTML Page. If this does not work, we need to trouble-shoot IIS Express.

    Best regards,
    Huy Nguyen

    Saturday, April 27, 2013 12:56 AM
  • I was hitting the same problem with the LightSwitch HTML Client. I tried your steps to delete the IISExpress directory, but I was unable to run a simple ASP.NET project. I receive the error:

    'Unable to launch the IIS Web Server'

    This all occurs on my Windows 7 machine. I'm able to launch LightSwitch Silverlight clients (in browser), but it appears stand-alone Silverlight projects with .Web hosts do not work because of the same IIS Web Server issue. I should note they may have never worked for me with VS2012 since I only use it for LightSwitch.

    I am able to run HTML clients on my Windows 8 machine since getting Update 2. It's so funny because during the "Preview 2" phase, it was the exact opposite. HTML client worked on Windows 7 but not Windows 8. Now it's reversed.

    Thanks for you help,

    • Edited by vanslyker Monday, April 29, 2013 2:47 PM
    Monday, April 29, 2013 2:46 PM
  • Thanks for your reply.  When I try to create the empty web application, I get the following message:

    "Web application projects are currently configured to use IIS Express. To switch back to using the Visual Studio Development server, change the development server option under the Projects and Solutions/Web Projects category of the Tools/Options menu. Configuring IIS Express failed with the following error:

    Filename: redirection.config

    Error: Cannot read configuration file"

    If I change the option so VS doesn't use IIS to create projects, I am able to create a project.  I can change the option back to using IIS and I can run the project, but I cannot create a new one.  The setting does not affect the Lightswitch HTML5 application.  I still get the same error message either way.

    I also uninstalled and reinstalled IIS Express 8 with no luck.

    I checked the permissions on the IIS Express folder and they are SYSTEM, Administrators and me.


    Monday, April 29, 2013 3:37 PM
  • Hi,

    Thanks for confirming the issue with IIS Express.

    • Before Visual Studio 2012 Update 2, LightSwitch Applications uses Visual Studio Development Server (Cassini Server is another name).
    • After Visual Studio 2012 Update 2: LightSwitch HTML Client Applications use IIS Express. LightSwitch Desktop Applications still use Visual Studio Development Server, but will use IIS Express once upgraded. Unfortunately there is no going back to Visual Studio Development Server in these cases.

    Once you get the Empty Web Application to use IIS Express, LightSwitch applications should work.

    • Try creating the Empty Web Application when launching Visual Studio as Administrator.
    • Try repair IIS Express - or the whole Visual Studio (IIS Express is part of VS).
    • Try posting on http://forums.iis.net/.

    That's all I can think of so far. I'll update the thread if I found some new information.

    Best regards,
    Huy Nguyen

    Monday, April 29, 2013 4:31 PM
  • I tried to repair VS2012 Update 2 and even uninstall Web Deploy 3.0, but none of that worked.

    Then I tried what Roy Kim posted on his blog here:

    Issue: Visual Studio 2012 > “Unable to launch the IIS Express Web Server”

    and it worked! I updated managedRuntimeVersion="v4.0" to managedRuntimeVersion="v4.0.30319" in 3 places within the applicationPools node of the applicationhost.config file. I have no idea if Visual Studio will ever wipe out my changes, but it worked immediately on my test projects (didn't even have to close and reopen VS).

    Monday, April 29, 2013 7:52 PM
  • After much research and trying things others have done, I ended up unitstalling VS2012 and IIS express 8 then reinstalling them.  When I try to create an empty web application, I get the following message:

    "Configuring Web http://localhost:52977 for ASP.NET failed. You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly.  Visual studio cannot detect whether this virtual root has been configured for use with ASP.NET 4.0. The likely cause is that you do not have sufficient priviledges to access the IIS metabase. You may need to manually configure this site for ASP.NET 4.0 in order for your site to run correctly."

    1. IIS 8, the ASP.NET v4.0, ASP.NET v4.0 Classic and DefaultAppPool are all configured to use .NET Framework Version 4.0.30319 (which is ASP.NET 4.5)

    2. The target framework for the project in VS is .NET Framework 4.5

    3. Does IIS 8 even use the IIS metabase?

    4. There are 2 applicationhost.config files.  One seems to be used by Visual studio and the other by WebMatrix 3.  They are both configured to use .Net 4.0.30319.

    When I try to run the application I get a message: "Unable to launch IIS Express Web server."

    When I try to run my Lightswitch HTML Client application I still get: "Unable to start LightSwitch Server."

    I have spent way too much time trying to make this work on my desktop computer. It works great on my Notebook computer!  I realize that this may be straying off topic, but I doing all of this so that I can write a Lightswitch HTML client on my desktop.

    Any help is greatly appreciated! Thanks.

    Wednesday, May 8, 2013 3:31 PM
  • Hi,

    I don't have much knowledge about IIS Express so I'm afraid I cannot offer any further help besides the basic trouble shooting steps above. I'm pretty sure that IIS 8 and IIS Express are two different processes that have their own configuration.

    One thing you mentioned is WebMatrix 3 and installing IIS Express separately. To use LIGHTSWITCH HTML Client, I've never had to installed WebMatrix 3. I just installed VS 2012 and installed Update 2. IIS Express was included. Maybe you can uninstall everything related to VS 2012 and just install VS 2012 clean?

    Otherwise the forum for IIS Express question is here.

    Best regards,

    Wednesday, May 8, 2013 4:17 PM
  • Huy,

    Thanks for your help.  I'll try posting on the other forum.  Just to keep everything straight, I only have IIS 8 Express.  I installed WebMatrix 3 several months ago to deploy a simple Orchard website.  I did uninstall and reinstall WebMatrix, Visual studio and IIS Express.  

    I'll head over to the IIS Express form and see if I get an answer.  If I do, I'll post a link back here in case anyone is looking.

    Thanks, again.

    Wednesday, May 8, 2013 5:41 PM
  • I am posting a solution that worked for me in case anybody winds up here with the same problem:

    1. Uninstall VS 2012
    2. Uninstall WebMatrix 3
    3. Uninstall IIS 8 Express
    4. Reinstall VS 2012 Update 2
    5. Repair .NET Framework 4.5 (I would try this first since things started working after I did this)
    6. Reinstall WebMatrix 3 
    • Marked as answer by GerryW4 Thursday, May 9, 2013 4:15 PM
    Thursday, May 9, 2013 4:15 PM