Jano
Jano

Reputation: 197

Deploy ASP.NET Application while Hiding Sources

When we deploy our ASP.NET MVC application all sources, controllers, views, etc. are copied.

This is not a problem when we deploy on our server, but when we are going to deploy a copy into external servers and we don't want to share our code.

Does not exist a tool to package into libraries? .NET Core seems to deploy into DLL files, but I don't find that functionality on ASP.NET MVC.

Upvotes: 0

Views: 266

Answers (1)

NightOwl888
NightOwl888

Reputation: 56849

Does not exist a tool to package into libraries?

Yes.

This is what publishing the application does - it prepares the application for deployment. When you publish, it will compile the source code and prepare only the assets your application needs to run into a deployment folder.

It compiles the source into libraries. Views are only compiled if you use the precompile views option, otherwise they are distributed as files.

Use the Publish tool to deploy to a local folder. The exact options available depend on your app type. In Solution Explorer, right-click your project and choose Publish, and then choose Folder. For more information, see Deploy to a local folder.

enter image description here

Tutorial: Publish your Hello World application with Visual Studio 2017

You can combine publishing with IIS Web Deploy in order to easily automate the process of deploying your web site.

Upvotes: 1

Related Questions