locked
How do I convert my functions/etc in app_code to a dll RRS feed

  • Question

  • User483055775 posted

    Specifically, I want to convert those to a dll to keep them secure.  Where can I get info on that?

    Thanks

    Thursday, September 11, 2014 3:54 PM

Answers

  • User-760709272 posted

    If you want your code compiled into a dll you should convert your site to a web application rather than a web site.  web apps are much better anyway.  Alas it won't let you "secure" the dll though, assuming you mean secure from decompilation.  You'll need to use an obfuscation tool for that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 11, 2014 4:11 PM

All replies

  • User-760709272 posted

    If you want your code compiled into a dll you should convert your site to a web application rather than a web site.  web apps are much better anyway.  Alas it won't let you "secure" the dll though, assuming you mean secure from decompilation.  You'll need to use an obfuscation tool for that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 11, 2014 4:11 PM
  • User-821857111 posted

    You can't convert a Web Pages app to a web application as suggested by AidyF. You can however download Visual Studio Express for Web and create a class library project and put your code in that. I've written about it here: http://www.mikesdotnetting.com/Article/224/Creating-Reusable-Components-For-ASP.NET-Razor-Web-Pages

    As far as obfuscators are concerned, someone announced that they are developing a free one the other day: http://forums.asp.net/t/2006536.aspx?Developing+free+NET+obfuscator+Need+feedback+

    Thursday, September 11, 2014 4:34 PM
  • User-760709272 posted

    Um, yes you can :)  I meant manually, it would just mean copying and pasting and moving some things around.

    Thursday, September 11, 2014 5:39 PM
  • User483055775 posted

    Mike, I have vs 2013 and use it when I need to debug these apps.  The code I want to keep private is the cshtml files in the app_code folder.  The code in these is in the form of algebraic functions.  How visible are these to the typical user?  

    Thanks

    DonnieS

    Thursday, September 11, 2014 11:11 PM
  • User-760709272 posted

    All your server c# code is protected from viewing by people browsing your site.  It is only visible by people who gain access to your server's hard drive.

    Friday, September 12, 2014 3:22 AM
  • User-821857111 posted

    Um, yes you can

    Are you saying 'Um, yes you can convert a Web Pages site to a Web Application project'? If so, that's incorrect. The Web Pages framework doesn't support Web Application projects. Web Forms supports both Web Site and Web Application projects; MVC only supports Web Application projects and Web Pages only supports Web Site projects.

    Friday, September 12, 2014 6:15 AM
  • User-760709272 posted

    I see you didn't read past the bit you quoted.

    Friday, September 12, 2014 6:17 AM
  • User-821857111 posted

    I read it, but didn't understand what you were trying to say, which is why I questioned it.

    Friday, September 12, 2014 6:19 AM
  • User483055775 posted

    I have both C# and Cshtml files in the app_code.  I have classes in .C# files and algebraic functions in cshtml files.  Are those visible to the people browsing my site.  I know the regular input forms, etc.  are - of course we look at that all the time, but any files in the app_code folder?  And who can gain access to the server's hard drive ?  Is this readily available or is this a hacker by definition?  Thanks AidyF and Mike.  

    DonnieS

    Friday, September 12, 2014 6:28 AM
  • User-821857111 posted

    Anything placed in your App_Code folder is not accessible to people viewing your site. App_Code contents are protected from being browsed by the ASP.NET framework. As AidyF said, the only people who could see the contents of the App_Code folder are those who might gain access to the web server's drive system or your development machine. Hosting company personnel might have access to the hard drive, and of course, hackers might be able to gain access if the server is not secured properly. Securing servers is not a topic for these forums, but you can reasonably expect most professional hosting companies to have taken the appropriate precautions against this happening. 

    Friday, September 12, 2014 6:51 AM
  • User483055775 posted

    Thanks Mike - that was what I hoped.  And i am going to follow your links and create reusable components - I have done that on other platforms over the years, and wanted to find out how to do that here.

    Friday, September 12, 2014 7:48 AM