Setting up IIS 10 and publishing a .net core 2.1 web application to IIS












0















I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).



Management Services



.net framework 4.6 features



After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).



After rebooting the system I've made sure that the services are running properly (see image below).



Services



All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:



IIS Site



The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:



Application Pool



I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).



App Pool Identity



I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).



IUSR



IIS_IUSRS



Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.



And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:



Publish 01



My connection validated just fine so I hit Next and setup the next step with the following settings:



Publish 02



I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.



Error



I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...



References



Host ASP.NET Core on Windows with IIS



Publishing and deploying a Razor Pages application to IIS on Windows



Deploying .NET Core apps with Visual Studio



Update #1



I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...



Update #2



Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...



AspNetCoreModule



Handler Mapping



Update #3



Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):



<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" />
</system.webServer>
</location>
</configuration>









share|improve this question

























  • Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

    – Mohsin Mehmood
    Nov 15 '18 at 22:17











  • @MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

    – Lord-Link
    Nov 16 '18 at 13:25











  • @MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

    – Lord-Link
    Nov 16 '18 at 14:16
















0















I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).



Management Services



.net framework 4.6 features



After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).



After rebooting the system I've made sure that the services are running properly (see image below).



Services



All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:



IIS Site



The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:



Application Pool



I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).



App Pool Identity



I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).



IUSR



IIS_IUSRS



Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.



And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:



Publish 01



My connection validated just fine so I hit Next and setup the next step with the following settings:



Publish 02



I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.



Error



I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...



References



Host ASP.NET Core on Windows with IIS



Publishing and deploying a Razor Pages application to IIS on Windows



Deploying .NET Core apps with Visual Studio



Update #1



I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...



Update #2



Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...



AspNetCoreModule



Handler Mapping



Update #3



Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):



<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" />
</system.webServer>
</location>
</configuration>









share|improve this question

























  • Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

    – Mohsin Mehmood
    Nov 15 '18 at 22:17











  • @MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

    – Lord-Link
    Nov 16 '18 at 13:25











  • @MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

    – Lord-Link
    Nov 16 '18 at 14:16














0












0








0








I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).



Management Services



.net framework 4.6 features



After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).



After rebooting the system I've made sure that the services are running properly (see image below).



Services



All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:



IIS Site



The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:



Application Pool



I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).



App Pool Identity



I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).



IUSR



IIS_IUSRS



Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.



And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:



Publish 01



My connection validated just fine so I hit Next and setup the next step with the following settings:



Publish 02



I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.



Error



I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...



References



Host ASP.NET Core on Windows with IIS



Publishing and deploying a Razor Pages application to IIS on Windows



Deploying .NET Core apps with Visual Studio



Update #1



I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...



Update #2



Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...



AspNetCoreModule



Handler Mapping



Update #3



Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):



<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" />
</system.webServer>
</location>
</configuration>









share|improve this question
















I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).



Management Services



.net framework 4.6 features



After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).



After rebooting the system I've made sure that the services are running properly (see image below).



Services



All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:



IIS Site



The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:



Application Pool



I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).



App Pool Identity



I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).



IUSR



IIS_IUSRS



Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.



And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:



Publish 01



My connection validated just fine so I hit Next and setup the next step with the following settings:



Publish 02



I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.



Error



I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...



References



Host ASP.NET Core on Windows with IIS



Publishing and deploying a Razor Pages application to IIS on Windows



Deploying .NET Core apps with Visual Studio



Update #1



I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...



Update #2



Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...



AspNetCoreModule



Handler Mapping



Update #3



Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):



<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" />
</system.webServer>
</location>
</configuration>






iis publishing iis-10 .net-core-2.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 13:23







Lord-Link

















asked Nov 15 '18 at 16:06









Lord-LinkLord-Link

41821233




41821233













  • Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

    – Mohsin Mehmood
    Nov 15 '18 at 22:17











  • @MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

    – Lord-Link
    Nov 16 '18 at 13:25











  • @MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

    – Lord-Link
    Nov 16 '18 at 14:16



















  • Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

    – Mohsin Mehmood
    Nov 15 '18 at 22:17











  • @MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

    – Lord-Link
    Nov 16 '18 at 13:25











  • @MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

    – Lord-Link
    Nov 16 '18 at 14:16

















Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

– Mohsin Mehmood
Nov 15 '18 at 22:17





Can you share the published web.config file contents? Also, have you ensured that .NET Core app works fine on local development environment?

– Mohsin Mehmood
Nov 15 '18 at 22:17













@MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

– Lord-Link
Nov 16 '18 at 13:25





@MohsinMehmood I just updated the question with the web.config file. I noticed the logging was off so I'm gonna try setting that to true and seeing if i get any logs created in the logs folder. The .Net application running locally from visual studio does work.

– Lord-Link
Nov 16 '18 at 13:25













@MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

– Lord-Link
Nov 16 '18 at 14:16





@MohsinMehmood After updating the web.config and setting the logs to true I was able to get a real error that I can at least work off (Just an FYI it was a SQL connection error)... I think that resolves my original issue of not knowing what else to do and thinking it was a bad IIS configuration causing the issue. I was just missing the switch for the logs to start working because I had created the logs folder but nothing ever really logged. If you want to just put in the answer to set the logging flag in the web.config to true I'll tick your answer off as the correct answer. Thanks!

– Lord-Link
Nov 16 '18 at 14:16












1 Answer
1






active

oldest

votes


















1














I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323452%2fsetting-up-iis-10-and-publishing-a-net-core-2-1-web-application-to-iis%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.






    share|improve this answer




























      1














      I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.






      share|improve this answer


























        1












        1








        1







        I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.






        share|improve this answer













        I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 16:49









        Mohsin MehmoodMohsin Mehmood

        2,4262513




        2,4262513
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323452%2fsetting-up-iis-10-and-publishing-a-net-core-2-1-web-application-to-iis%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values