I am trying to publish my web api in .net core 2.1 with system files ...but when I publish it, in my computer I only see .dll , .json , but not others files , so I don’t know how to do that publish and put all the files in my IIS I need an special configuration in my web api ? Or how can I do?
2 Answers
Check out these links
https://learn.microsoft.com/en-us/dotnet/core/deploying/
https://learn.microsoft.com/en-gb/aspnet/core/host-and-deploy/iis/?tabs=aspnetcore2x
https://andrewlock.net/exploring-program-and-startup-in-asp-net-core-2-preview1-2/
https://stackify.com/how-to-deploy-asp-net-core-to-iis/
Running dotnet publish
will generate the contents which you put in a directory pointed out in your IIS application pool (you specify the directory during the server application pool's set up - check the links)
Yes, in some way you need a special configuration file - web.config

- 2,363
- 2
- 16
- 20
-
I already wrote in the cmd dotnet publish, and in my folde I see the files...but when I open the api in my browser , I see the error: Error HTTP 500.19 - Internal Server Error – 365lol Jan 26 '19 at 22:33
-
Does the error contain the details?Do you have the web.config file defined? Do you have files with names like appsettings.*.json inside your project's directory? – kasptom Jan 26 '19 at 22:46
-
You can also try to search for the logs from the IIS using [event viewer](https://stackoverflow.com/a/51912729/4880379) – kasptom Jan 26 '19 at 22:54
You need to install the SDK
Check: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1
Install -> dotnet-hosting-2.1.3-win.exe Commands:
-> net stop was y
-> net start w3svc
Restart IIS
AppPool -> NoManagedCode - Integrated
After is just like publishing a normal asp.net project in IIS.

- 51
- 4
-
I already installed the SDK...next I published my web api in a folder, but when I try to test it, I have this error Error HTTP 500.19 - Internal Server Error and in my Program.cs public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup
() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .Build(); – 365lol Jan 26 '19 at 22:30 -
@365lol Have you [installed the .net core hosting bundle](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2#install-the-net-core-hosting-bundle)? – Ryan Jan 28 '19 at 05:08
-