Transfer the WebApi application to another PC, test it, without a development environment?

Markus Freitag 3,786 Reputation points
2023-09-24T16:42:14.5033333+00:00

Hello,

@AgaveJoe

https://learn.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules

The target machine needs a host like IIS to host Web API.

We have no idea how your network is setup so we can't provide much information.

I use Windows10 Prof.

I have written a server that I now need to install on the target machine.

C# Desktop App is installed on the target computer.

Both are installed locally on the PC.

The link described is difficult to understand if I have never created it.

Do you have or know a good youtube installation video?

Picture Server

_App_1

Which files from the server need to go to the target computer and to which location?

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

Accepted answer
  1. Bruce (SqlWork.com) 58,441 Reputation points
    2023-10-23T16:44:47.0333333+00:00

    as you have a asp.net app to deploy, on the target machine:

    1. install IIS with .net 4.* support
    2. create a folder to publish to
    3. create an application. pointing to the publish folder. be sure the app pool account has access to the folder
    4. from the app machine do a folder publish the publish folder you created on the target machine.

    see:

    https://learn.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules


3 additional answers

Sort by: Most helpful
  1. P a u l 10,406 Reputation points
    2023-09-24T17:20:26.6233333+00:00

    Here's a very quick tutorial video about how you would deploy a Web API project on your local development machine to IIS:

    https://www.youtube.com/watch?v=GHT7gdfhUNw

    Importantly he explains how to "Publish" the project, rather just building it. In your screenshot you're showing the build output of your project, which is fine to use as your "Physical path" when developing locally, but in production (i.e. on your server) you'll want to point IIS at the published path instead.

    This shows how to do the setup on the server, view it over localhost & even how to reveal the app to your network by using your network private IP, but how you expose the API to the public is entirely up to you/your network admin.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
    2023-09-25T18:48:16.03+00:00

    Only ASP.NET Core makes it simple and easy to develop and test on any machine you like,

    1. Create a new folder on your dev machine.
    2. Install .NET SDK (for any of .NET 6/7/8).
    3. Open command prompt and navigate to that folder.
    4. Use dotnet new webapi to generate a sample project (REST API).
    5. Use dotnet run to test it locally.
    6. Use dotnet publish --self-contained -r win-x64 to generate Windows x64 deployment artifacts (runtime is bundled, so no need to install extra runtime on target machine).
    7. Copy the artifacts to any Windows x64 machine like your test machine and launch it there (Kestrel self hosting is used, so no need to install IIS).

    The sample project can easily walk you through all the steps above. Then you can copy/paste most of the code from controllers of your existing project so as to finish ASP.NET 4.x to ASP.NET Core migration.