0

I have an ASP.NET Core 2 web application developed in VS 2017. I just tried to publish it in a local folder via VS 2017. Now, I have a local folder with my application stuff and some things need clarification:

  1. The files created inside the folder are exactly the same with those which should be created if we deploy in Azure?
  2. web.config file has been created after deployment while there was not such a file in the development phase. Why?
  3. How may I run this deployed project? There are a lot of .dll files.

I am new to .NET world and I want to understand some things.

1 Answer 1

1

The result of publishing an ASP.NET Core app, is mostly just the result of building, i.e. everything gets compiled to DLLs. There is no difference here deploying to IIS or Azure.

The Web.config is added for the sake of IIS. If you open it up, you'll see it's very light on the actual configuration. It mostly just directs IIS to run the app using dotnet.exe. ASP.NET Core doesn't utilize Web.config, relying instead on various configuration providers, and principally among those, appsettings.json.

The easiest way to run the app is just:

dotnet MyApp.dll

In a console window. The DLL should be that of the main application, which will have the same name as your project.

Sign up to request clarification or add additional context in comments.

3 Comments

Awesome! Does the WebHost build both IIS and Kestrel locally?
No. Or rather, not really sure what you mean by that. Both IIS and Kestrel are external by default. All of you is the application binaries. If you run via dotnet.exe, it's going to use the installed runtime's Kestrel. If you deploy to IIS, well obviously IIS is installed on the server. You can build as self-hosted, which basically packages up the runtime into the build, in which case you get an exe instead of a DLL.
Your last sentence implies Ctrl-F5, isn't it? Where is this .exe? And in that case do we have both IIS and Kestrel?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.