1

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...

1
  • 2
    You must enforce your website to rebuild. Try making any change on the Web.config file after updating a DLL. Commented Apr 4, 2013 at 14:55

2 Answers 2

3

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.

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

1 Comment

So, after build operation, it is enough to post only .dll file that contains my changed class to host, right?
1

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 a c# 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.

Comments

Your Answer

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