Reputation: 1389
I have an ASP.NET application that i deployed to a server by copying the project to the server and then configuring IIS. What happens now is that i need to prevent the access to the code. Is there any way to do this? Do i need to deploy in a different way or is there a way to somehow "encrypt" the code thus rendering it unreadable?
Regards,
Upvotes: 1
Views: 2253
Reputation: 498904
You can use an obfuscator such as dotFuscator on your assemblies.
The better obfuscators will stump most decompilers (such as Reflector), but are normally not free.
Update:
Seeing as you mean that you simply do not want code to be deployed with your application:
Publishing should be enough, so long as you don't use the app_code
folder - code in this folder will be deployed as is.
Upvotes: 1
Reputation: 3994
A simple way is to obfuscate the code. This doens't hide the code per se, but it makes it very difficult to read and understand.
See this wiki page for more information.
On another note, if you publish the application by using the release configuration, you'll only upload assemblies and other parts vital for the site, not the source code in readable form. Be wary though, the dll's can be reverse engineered.
Upvotes: 2
Reputation: 44595
Yes you should only publish.
inside Visual Studio, in solution explorer, right click on the web project and select publish.
this will create all you need to deploy ( pages, assemblies, resources...) but will not include the source code.
Upvotes: 4