locked
problem deploying to IIS - 403 error RRS feed

  • Question

  • I've already deployed 3 LS applications on an intranet IIS server (IIS 7 - win server 2008 R2). These were done with VS2012 Update 1.

    I've just created a new small LS application with VS2012 update2. The application is using the Silverlight client (not the HTML 5 one). It is working fine on my computer. The deployement wizard is not reporting any error. The application is installed under the same web site as my other applications that are running fine. However, whenever I try to start the new application, I get a 403 error (you are not authorized to see resources).

    I compare the settings fo the new application with the old one and they all seem to be identical.

    I do not master IIS configuration.  Any help will be welcome.

    Thanks

    Monday, June 17, 2013 1:47 PM

Answers

  • Hi,

    I'm not sure whether you guys found a solution to this problem already.. because your posts are well over 6 months ago... but I found a solution to this just now as I was tinkering with the my LS 2012 Update 2 project.

    Basically you have to do 2 things:

    Step 1: Modify the default.htm file in the Client project (in File View) as such:

    a) Replace the line:

    <script type="text/javascript" src="Silverlight.js"></script>

    with

    <script type="text/javascript" src="Client/Silverlight.js"></script>

    b) Replace the line:

    <param name="source" value="Web/AppName.Client.xap"/>

    with

    <param name="source" value="Client/Web/AppName.Client.xap"/>


    Step 2: There's 2 alternatives to this step ie. you can either do one or the other.

    Alternative #1:

    After publishing your application to your IIS server, physically move the default.htm file from the Client folder to the root folder of your application. Taking the example given by Ragoran above, it's taking the default.htm file out of the AppName/Desktopclient folder and putting it into the AppName folder instead.

    Alternative #2:

    If you don't have access to/permissions on your IIS server to perform such file manipulations, you can use this approach instead... Prior to publishing you application to IIS, edit the web.config file found in the Server project (in File View) as such:

    Replace the line below:

    <add value="default.htm" />

    with

    <add value="Client/default.htm" />

    Now, when you publish your application to IIS, it should work as expected ie. browsing http://ServerName/AppName should just work! Personally, I prefer this method as you don't have to do anything else on your IIS server post-publication of your application.

    Maybe this is hackish way to solve the problem but I think Microsoft should provide us with a better solution.


    Tuesday, April 29, 2014 4:23 PM

All replies

  • Found the problem.

    When deploying "Update 1" LS application, the default.htm page was in the site root folder. With "Update 2", this is under DesktopClient (or HTMLClient) sub-folder, so the path to my application is

    ServerName/AppName/Desktopclient

    instead of just

    ServerName/AppName

    Can I put a default.html in the root folder to point to the correct sub folder base on the browser device type?

    Monday, June 17, 2013 6:47 PM
  • Thanks for pointing this out. I have been having this same problem when I updated to Update 2 as well, so I guess this wasn't just me.
    Tuesday, June 18, 2013 1:04 PM
  • I have the exact same problem! I have apps developed using LS 2011, LS 2012 (prior  to Update 2) running fine on the same server. But my Update 2 apps.. 403 forbidden although I've set the app to have no authentication whatsoever. 

    Now I'm regretting upgrading my project (to Update 2) in VS! I really didn't expect this to happen!

    Tuesday, April 29, 2014 8:45 AM
  • Hi,

    I'm not sure whether you guys found a solution to this problem already.. because your posts are well over 6 months ago... but I found a solution to this just now as I was tinkering with the my LS 2012 Update 2 project.

    Basically you have to do 2 things:

    Step 1: Modify the default.htm file in the Client project (in File View) as such:

    a) Replace the line:

    <script type="text/javascript" src="Silverlight.js"></script>

    with

    <script type="text/javascript" src="Client/Silverlight.js"></script>

    b) Replace the line:

    <param name="source" value="Web/AppName.Client.xap"/>

    with

    <param name="source" value="Client/Web/AppName.Client.xap"/>


    Step 2: There's 2 alternatives to this step ie. you can either do one or the other.

    Alternative #1:

    After publishing your application to your IIS server, physically move the default.htm file from the Client folder to the root folder of your application. Taking the example given by Ragoran above, it's taking the default.htm file out of the AppName/Desktopclient folder and putting it into the AppName folder instead.

    Alternative #2:

    If you don't have access to/permissions on your IIS server to perform such file manipulations, you can use this approach instead... Prior to publishing you application to IIS, edit the web.config file found in the Server project (in File View) as such:

    Replace the line below:

    <add value="default.htm" />

    with

    <add value="Client/default.htm" />

    Now, when you publish your application to IIS, it should work as expected ie. browsing http://ServerName/AppName should just work! Personally, I prefer this method as you don't have to do anything else on your IIS server post-publication of your application.

    Maybe this is hackish way to solve the problem but I think Microsoft should provide us with a better solution.


    Tuesday, April 29, 2014 4:23 PM