Hosting CSHTML on Windows ServerRSS

2 replies

Last post May 28, 2019 07:54 AM by Able

  • Hosting CSHTML on Windows Server

    May 27, 2019 03:39 PM|aogden2013|LINK

    I created a .cshtml website in Visual Studio. Now I'm not sure how to host that project on my Windows Server. It's a Windows Server 2012 R2. Before, I've hosted regular html files by dropping them in the wwwroot folder of inetpub. I know that I need to use the ASP.NET of IIS to use the cshtml file type, but I'm new to it and not sure what the steps are to be able to view my project online.

  • Re: Hosting CSHTML on Windows Server

    May 27, 2019 06:52 PM|lextm|LINK

    There are a few ASP.NET/ASP.NET Core project types using cshtml files,

    • ASP.NET MVC
    • ASP.NET Core MVC
    • ASP.NET Core Razor Pages
    • ASP.NET Web Pages 

    So before anyone comments further, you must reveal what exactly is the project type you use. Also, such questions are programming related, so ASP.NET forums are the best place,

    https://forums.asp.net/ 

    Lex Li
    IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Hosting CSHTML on Windows Server

    May 28, 2019 07:54 AM|Able|LINK

    Hi aogden2013,

    According to your description, if you want to host your application on iis server , you should firstly publish it on iis, and it will show the default page in your application.Else you should add configuration like .net framework features for in iis service  to host asp.net application.

    Here is the link ,I hope it could help you.

    https://docs.microsoft.com/en-us/visualstudio/deployment/tutorial-import-publish-settings-iis?view=vs-2019

    Best Regards

    Able

    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.