Save ASP.NET code files on server?

I am inheriting a web application, and the previous programmer compiled all of its code into a .dll. There are no .cs files on the server.

While working on previous projects, I always downloaded the .aspx file and the corresponding .cs file. This was never a problem for me, and I always thought it was a standard procedure. Am I wrong or just paranoid?

+4
source share
6 answers

Will, I think, it is quite common for the code to be precompiled in the dll. Then the code is less exposed to potential security holes. It also provides many benefits, which include faster initial response time, error checking, source code protection, and efficient deployment. This is especially important on large sites where changes to web pages and code files often occur.

+3
source

Source code as part of a project is not necessarily the best source code management process. There are tools for this.

In addition, the preliminary compiler of the source code is not unusual (it is a web application project, not a website project in Visual Studio) and has many advantages.

Please note that this does not make you wrong or paranoid.

+2
source

There are good reasons for both strategies that you just need to figure out what works best for your environment and application.

In a sense, it is good if it is precompiled, if you are worried that someone accidentally made changes to the server, but did not check the change in the source control. If you do not have control over the changes on your server, it is not difficult for you to understand who made the changes “by accident” and why did not check it.

On the other hand, if you do not precompile, this can make deployment more direct.

Just do a little research on both strategies and decide what works best in your situation.

0
source

As Nader pointed out, in a web application you don’t need CS files at all. There is a huge risk that the source files will be serviced by accident, since protecting these files is a primary function of IIS request management. However, it is generally recommended that you do not deploy them to the production web server.

In any case, the source files should always be backed up with a minimum minimum in a place that is not a web server, and, if possible, should be controlled by the source. I saw too many sites where the source files were lost, and as a result the site was useless.

0
source

As with all of the above, compiling source code into DLLs is considered best practice.

If you want to see the DLL code that you have left, there is a convenient (and free!) Tool called Reflector (sorry if you already received it)

http://www.red-gate.com/products/reflector/

Just load the DLL and then parse it to view the source.

0
source

Web application projects are compiled into .dll and do not leave any sources on the server.

Website projects deploy the entire source on the server.

This is the religious war that is best. Google will present you with many different opinions, so I won’t click on my opinions.

0
source

All Articles