locked
Deploy LightSwitch project on IIS 6.0 RRS feed

  • Question

  • User765642432 posted
    Hi, I'm a total beginner in IIS so please forgive my ignorance... We are creating a Microsoft Lightswitch application for a customer. The customer has a Win 2003 R2 / IIS 6.0 environment. We want to deploy our Lightswitch project in IIS 6.0 but we don't know how. In IIS 7.0 there is a handy "Import application" functionality where the user browses for the correct .zip file (i.e. the Lightswitch project output) and then sets the configuration settings (database connections etc). However, in IIS 6.0 there is no such functionality. I've looked for documentation in Microsoft sites but no luck. Do you know how I can import my Lightswitch application to the customer's sever? Regards, Kostas
    Tuesday, January 31, 2012 9:07 AM

Answers

  • User765642432 posted
    Hi, I think that I finally solved my problem and the deployment procedure seems to work. I really wish that nobody else passes through all this situation I've been into so I wrote down all the steps: 1) In Lishtswitch, I performed a publish selecting "Create a package on disk" as a publish output. 2) In SSMS, I created the LS Database manually (just created it, no tables are created during this step). 3) I edited the parameters.xml file (it is inside the zip package) and filled in the correct "default values". It seems that when you publish that way some values inside the xml file remain empty. E.g. you have to manually add the DB server name, the connection string etc (at least in my case). 4) After saving the parameters.xml file and putting it again back inside the zip package, I copied the whole zip file to the application server. 5) I logged in the application server as administrator and ran the following command in command prompt: "C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -source:package=c:\ssmsproject.zip -dest:auto,IncludeAcls='False',AuthType='Basic', -verb:sync (The truth is that I'm not very aware of all these parameters. What I observed is that after running this command the application is deployed under the "Default Web Site" and the Application Database has the appropriate schema for the LS application). 6) Although the application is in place, I had to change two more properties in IIS Manager: a) Set the correct ASP.NET version (i.e. 4.0.30319) and b) Go to Directory Security > Authentication and Access Control and disable anonymous access and enable Integrated Windows Authentication (that's the authentication I have chosen for my app). I suspect that step 6b could have been embedded in step 5 but I don't know the appropriate syntax. 7) So, everything is in place now, apart from the security administrator. I discovered a handy command line tool which can insert the security administrator inside the application DB without much effort. The tool is "Microsoft.LightSwitch.SecurityAdmin.exe" and you'll find it in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\LightSwitch\1.0\Tools". You have to copy the exe as well as the rest of the .dll files located inside that folder to your application server in order to be able to run the tool. The tool's syntax is fairly easy: (in my case) C:\lightswitch\Microsoft.LightSwitch.SecurityAdmin.exe /createadmin /user:mydomain\kostask /config:C:\Inetpub\wwwroot\SSMSProject\web.config 8) Finally, I opened the application server's url loggen on in Windows as my app's administrator and installed the application in my pc. Best Regards Kostas
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, February 6, 2012 7:19 AM

All replies

  • User765642432 posted
    Hi, Thank you for the answer. I've seen this article and it is quite comprehensive. Unfortunately it describes how to import the exported package in IIS 7 and not in IIS 6. Since the two versions are quite different, I don't know what to do in order to import the package in IIS 6. It is so easy in IIS 7! Any recommendation would be highly appreciated! Regards, Kostas
    Wednesday, February 1, 2012 2:10 AM
  • User-1672167363 posted

    Hi,

    Have you asked at the dedicated Visual Studio LightSwitch Forums

     http://social.msdn.microsoft.com/Forums/en-US/lightswitch/threads they are the Experts.

    Can you update the thread for what you find out :D

    Regards,

    Martin

     

    Wednesday, February 1, 2012 7:37 PM
  • User744767459 posted

    Hi,

    You have multiple options here. In the Publish Wizard, you can choose "local" to publish project to local machine, then manually create site/application on IIS server, copy the published content to IIS server.

    You can also remotely publish to your IIS server instead of create a package. If you want to create a package, you can import the package on your IIS6 server by using command line

    Web Deploy package Provider
    http://technet.microsoft.com/en-us/library/dd569019(WS.10).aspx

    As Martin mentioned, Visual Studio LightSwitch Forums is also a nice place to ask for help. Thanks.

    Thursday, February 2, 2012 3:50 AM
  • User765642432 posted
    Hi and thanks for the answers. The truth is that I have asked this in LS Forums before asking it here. LS Forums are indeed a great place to solve problems. However, nobody has answered this question yet, so I thought it might be mostly an IIS related question. Anyway, it seems that I have to dive into the Web Deploy package Provider as Leo suggests since we will perform a remote deployment to the customer. I wish IIS 6.0 had the "Import Application" functionality as IIS 7.0!!! Anyway, I will post the results of my tries as soon as possible. Thanks again for your assistance Kostas
    Thursday, February 2, 2012 4:26 AM
  • User765642432 posted
    Hi, I think that I finally solved my problem and the deployment procedure seems to work. I really wish that nobody else passes through all this situation I've been into so I wrote down all the steps: 1) In Lishtswitch, I performed a publish selecting "Create a package on disk" as a publish output. 2) In SSMS, I created the LS Database manually (just created it, no tables are created during this step). 3) I edited the parameters.xml file (it is inside the zip package) and filled in the correct "default values". It seems that when you publish that way some values inside the xml file remain empty. E.g. you have to manually add the DB server name, the connection string etc (at least in my case). 4) After saving the parameters.xml file and putting it again back inside the zip package, I copied the whole zip file to the application server. 5) I logged in the application server as administrator and ran the following command in command prompt: "C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -source:package=c:\ssmsproject.zip -dest:auto,IncludeAcls='False',AuthType='Basic', -verb:sync (The truth is that I'm not very aware of all these parameters. What I observed is that after running this command the application is deployed under the "Default Web Site" and the Application Database has the appropriate schema for the LS application). 6) Although the application is in place, I had to change two more properties in IIS Manager: a) Set the correct ASP.NET version (i.e. 4.0.30319) and b) Go to Directory Security > Authentication and Access Control and disable anonymous access and enable Integrated Windows Authentication (that's the authentication I have chosen for my app). I suspect that step 6b could have been embedded in step 5 but I don't know the appropriate syntax. 7) So, everything is in place now, apart from the security administrator. I discovered a handy command line tool which can insert the security administrator inside the application DB without much effort. The tool is "Microsoft.LightSwitch.SecurityAdmin.exe" and you'll find it in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\LightSwitch\1.0\Tools". You have to copy the exe as well as the rest of the .dll files located inside that folder to your application server in order to be able to run the tool. The tool's syntax is fairly easy: (in my case) C:\lightswitch\Microsoft.LightSwitch.SecurityAdmin.exe /createadmin /user:mydomain\kostask /config:C:\Inetpub\wwwroot\SSMSProject\web.config 8) Finally, I opened the application server's url loggen on in Windows as my app's administrator and installed the application in my pc. Best Regards Kostas
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, February 6, 2012 7:19 AM