locked
How to open and run old razor webpages on visual studio for mac? RRS feed

  • Question

  • User-352524747 posted

    How to open / run old razor webpages using visual studio on mac?

    Saturday, August 8, 2020 5:06 PM

Answers

  • User-821857111 posted

    The old ASP.NET Web Pages framework is dependent on the full .NET framework, which is not compatible with Unix or Mac OS. The only way to run a Web Pages app on a Mac is in a virtual machine running Windows.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 10, 2020 8:29 AM

All replies

  • User-1330468790 posted

    Hi dow7,

     

    It depends on what kind of the "old" razor webpage it is. I think the "razor webpages" here is Razor Page.

    If you have an old razor page project, you might need to import the necessary modules with compatible ASP.NET Core framework.

     

    From the worst condition, if you only have one/few cshtml file(s) with code behind, you might need to add other necessary files/folders:

    1. Launch settingsThe launchSettings.json file contains the IIS settings, the application URL, and other related settings.
    2. App settings: The appSettings.json file contains configuration data such as connection strings. For more information about configuration, see the Configuration in ASP.NET guide.
    3. wwwroot folderThis folder contains static files, such as HTML, JavaScript, and CSS files. For more information, see Static files in ASP.NET Core.
    4. Program.csThis file contains the entry point for the program. For more information, see ASP.NET Core Web Host.
    5. Startup.csThis file contains code that configures app behavior, such as whether the app requires consent for cookies. For more information, see App startup in ASP.NET Core.

    The easiest way would be creating a new razor page project and add this razor page into the project. You could refer to this: 

    Create Razor web apps

     

    Hope this can help you.

    Best regards,

    Sean

    Monday, August 10, 2020 8:16 AM
  • User-821857111 posted

    The old ASP.NET Web Pages framework is dependent on the full .NET framework, which is not compatible with Unix or Mac OS. The only way to run a Web Pages app on a Mac is in a virtual machine running Windows.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 10, 2020 8:29 AM