Could not deploy Razor web page to a IIS server.

Robert Lovas 20 Reputation points
2023-12-22T15:58:31.36+00:00

I am trying to install / deploy a Razor page web application using the the VS2019 and VS2022 tools. Even when I run the command on the IIS server locally, I get this message snippet in the messages returned.

Could not connect to the remote computer ("devsandbox.xxxxxx.org"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at:

This is command that I used to start the process

RecoverHouseUserPage.deploy.cmd /Y /M:devsandbox /U:myuserid /P:mypassword /G:False /A:Basic

I could not find if/where the 'Web Deploy' is installed.

Is there another way to deploy to IIS without the 'Web Deploy' being installed

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,281 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,358 questions
{count} votes

Accepted answer
  1. Yurong Dai-MSFT 2,806 Reputation points Microsoft Vendor
    2023-12-25T09:33:27.79+00:00

    Hi @Robert Lovas,

    If you want to deploy to IIS without installing "Web Deploy", you can publish the project to your local desktop and then copy it to the site directory or upload the site directory via FTP.

    1.File system deployment:

    • Build your Razor page web application.
    • Manually copy the build output to the target IIS server.
    • Configure the IIS site to point to the directory where the replication application is replicated.
    • This method is simple, but may require additional manual steps, especially if your application has dependencies or settings that need to be configured on the server.

    2.FTP deployment:

    • Build your Razor page web application.
    • Use FTP to transfer the build output to the target IIS server.
    • Configure the IIS site to point to the directory where you uploaded the application.
    • This method is similar to file system deployment, but uses FTP for transfer. Visual Studio has built-in support for FTP deployment.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.

    Best regards,

    Yurong Dai

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 59,016 Reputation points
    2023-12-25T18:01:26.1333333+00:00

    Note the IIS server will need the aspnet core module installed

    https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-8.0

    you will need to define a webapp and pool account. You will define the location where deployed file go.

    0 comments No comments

  2. Robert Lovas 20 Reputation points
    2024-01-09T15:04:24.7+00:00

    Did option #1 - 'File system deployment'. That worked for the a simple Razor Page app.

    Thanks to all contributors on the thread/issue

    Bob

    0 comments No comments

  3. Robert Lovas 20 Reputation points
    2024-01-09T15:08:41.9266667+00:00

    Did option #1 - 'File system deployment'. That worked for the a simple Razor Page app.

    Thanks to all contributors on the thread/issue

    Bob

    0 commentsNo commentsReport a concern

    0 comments No comments