Last post Aug 03, 2017 02:04 PM by kaushalparik27
Aug 03, 2017 06:35 AM|hkbeer|LINK
I have been using RAD method to build ASP.Net (Web Form) by Creating WebSite (instead of Project) on VS2016.
I just copy to production server and it runs instantly.
Now I have finished and I come to the point I wish to compile so the others are not easy to get my code to protect my work.
What is the way to compile using VS2017 ?
Any link and good reference ? I do not need super protection from reverse engineering, just certain level of protection is good enough.
Aug 03, 2017 07:48 AM|PatriceSc|LINK
Try the "publish" option (it shoould just call the aspnet_compiler tool mentioned in the later link). You should be able to precompile the web site:
For a more general strategy try perhaps
https://msdn.microsoft.com/en-us/library/dd547590(v=vs.110).aspx to see which kind of project best fit your needs.
Aug 03, 2017 07:50 AM|kaushalparik27|LINK
You can Publish/Pre-compile your website instead of copying code directly to server while hosting.
To do this, right click on your website in Solution Explorer and chose second option, Publish web app.
This will open a dialog for PreCompile your website and create published content. It will result in creating binaries for your code based on the Publish option that you chose. In the newly opened dialog, Create a new profile by giving meaningful name.
Click next and then chose File System as Publish Method,
Click next, and you will be presented with few more publish options. Important option is, second checkbox that say "Precompile during publishing". This is the option that helps you to convert your .cs code to binaries/dll files resulting in bin folder.
If you observe, there is a Configure link given beside that checkbox, which is important to how you want to Precompile your website. I mean whether you wanted to have a single dll (not suggested) for entire website or you wanted to have separate dll (suggested)
per page and rest other important options. Why I said separate dll per page is suggested because in case of any issue resolution in a certain webpage, if you need to update your website, you will be able to Precompile with this created profile and only update
that required dll file of that aspx page only instead of updating entire website. Please observe these Merge options, that I am talking about:
And that is all it! Click Next and Publish. It will create published content on the path that you have specified while publishing in above steps (You are supposed to upload this PreCompiled content now). Next time, when you require to publish you will have
this publish profile pre-selected and you don't need to perform all these steps every time!
Aug 03, 2017 11:42 AM|hkbeer|LINK
Thanks a lot. This is very detailed, thank you.
I have a problem in that in this screen the only option to me is Debug there is no "Release" option for me to choose from.
Do you know anything I need to do ? I already login using Microsoft account...
Aug 03, 2017 01:23 PM|kaushalparik27|LINK
I have not faced this earlier. I suggest you to refer below related thread, if you may get some hint on:
Aug 03, 2017 01:40 PM|hkbeer|LINK
OK Now, created "Release" item and it have published as desired I can see the new dll now.
So the aspx stay the same as before.... its ok since they can be viewed by view source anyway.
But the web.config is not compiled. It has a lot of password in it etc. Can this file be encrypted ?
Aug 03, 2017 01:52 PM|hkbeer|LINK
Aug 03, 2017 02:04 PM|kaushalparik27|LINK
There are alternatives. Idea is to store encrypted/hashed password: