Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I edit Asp.net Mvc cshtml after publish?

Tags:

asp.net-mvc

Is it possible to edit the .cshtml files after publish or are there any draw backs?

like image 763
eadam Avatar asked Aug 24 '12 00:08

eadam


People also ask

How can I edit startup CS file after publishing project?

You could use DotPeek (jetbrains.com/decompiler) to decompile the DLL's within the bin folder of your published site.

Is Cshtml the same as Razor?

razor helps you embed serverside code like C# code into web pages. cshtml is just a file extension. razor view engine is used to convert razor pages(. cshtml) to html.

What is the difference between Cshtml and ASPX?

One major advantage to aspx compared to cshtml is that you can view and edit the page itself (WUSIWYG kind of) using the design tab. With cshtml files you might as well use notepad to edit your html page. You are working "in the dark". @nivs1978: I actually find this to be a down-side of it.


1 Answers

Yes, you can edit the .cshtml file after you publish it.

Yes, there are drawbacks.

  • If you edit on the production server, you are bypassing QA
  • You are not going through a proper build cycle
  • You must integrate this change into version control

I strongly recommend adhering to a cycle

  • Code
  • Unit test
  • Check in
  • Publish / Deploy to QA
  • Test in QA
  • Go back to "Code" as needed
  • Publish / Deploy to PROD
  • If something breaks, go back to "Code"

Use a version control system that supports branching and tagging to make that cycle much easier.

Even if "QA" is a VM on your development server and you put on the "QA" hat, I would not skip that step.

like image 124
Eric J. Avatar answered Sep 21 '22 22:09

Eric J.