简体   繁体   中英

asp.net mvc update website after build operation?

in asp.net mvc project, you cant see the changes, before project building. I have a website on a hosting company, I changed some C# code, and I build the project on my local. If I post only changed class, I cant see changes. (of course, css and html codes are changing, after updating, and posting them to host)

So, Should I publish my project after project building, every time? Is there any simple way to update changed class (just post changed class to host)? What is the website updating steps?

Thanks...

If you're used to the old "website" projects where you'd keep code in an App_Code folder, you could simply update a code (.cs/.vb) file and the site would recompile.

However, most web projects (including ASP.NET MVC projects) are "web application " projects where all of the compiled code is in the bin folder. Any code files on the server would really be superfluous as the compiled code is already in the assemblies (.DLL files).

So, you'd have to update the .DLL files in your bin folder on the server. For example by doing a "Publish" to ensure only changed files are uploaded to your hosting Environment.

In a ASP MVC website, if you change server side code (c#,VB) you need to post the affected Dlls to the production server, is the only way. Tou cannot upload ac# file alone.

Only if you change client code you can post to the server the files (cshtml, js, css) without upload dlls and without recompile the App.

You can publish the Project to a local folder and upload only the necesary files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM