Use NGEN with WebDeployment

Last post 07-29-2008 5:57 AM by merlintintintin. 6 replies.

Sort Posts:

  • Use NGEN with WebDeployment

    07-18-2008, 4:18 AM

    Hello,

    I'm using WebDeployment to deploy (to install) an intranet web application. I compile all aspx.cs class to one DLL. I have 2 more DLL that are personal libray and that are used by my application. So, I have actually 3 DLL. I would like to use NGEN to create DLL in native code during project installation.

    NGEN INSTALL MYDLL1.DLL

    NGEN INSTALL MYDLL2.DLL

    NGEN INSTALL MYDLL3.DLL

    Could you tell me how to use NGEN with WebDeployment Project to register my three DLL ? Have I to add command line in project file (XML) - witch section ?

     

    Second point:  I would like also to use Dotfuscator community 3.0 with WebDeployment - if you have an article on the subject it would be great ! I have tried by when method are renamed to aa, bb, cc. the application don't found anymore the methods of my project... :(

     Regards,

    La Richesse & la Gloire ne griseront jamais que les temples...
  • Re: Use NGEN with WebDeployment

    07-22-2008, 11:04 PM

    Hi,

    You can use Web Deployment project's post-build to run "NGEN" after it is compiled. You can add the following code to Web Deployment project file to execute the command:

      <Target  Name="AfterBuild" >
        <Exec Command="Your command line" ></Exec>
      </Target>

    For more information about Dotfuscator community 3.0, see http://msdn.microsoft.com/en-us/library/ms227240(VS.80).aspx and for how to use it in command line, see Command Line Quick Start  (http://msdn.microsoft.com/en-us/library/ms227284(VS.80).aspx).

     

    I look forward to receiving your test results.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Use NGEN with WebDeployment

    07-23-2008, 2:44 AM

    Hi !

    Thanks for information.

    This is funny because it is the subject of an other post (of mine).

    http://forums.asp.net/p/1293534/2505304.aspx#2505304

    Strangly, what you suggest is not properly working on my system - it's seem's that AfterBuild event is not fired.. finally i have used AfterMerge (to delete folder) and it is fine .

     I have also launch dotfuscator on PreBuild event in property of install project.

     

    2 questions now:

    - When dotfuscator compilation is finished - a report appears. Is it a way to do not display this report ?

    - I obfuscate but I have a problem with the following line (from my web.config) - this is used to call service.

        <httpHandlers>

        <add verb="*" path="*.s" type="MyPersonalClass, MyPersonalAssembly"/>

       </httpHandlers>

    Parser Error Message: Could not load type 'MyPersonalClass' from assembly 'MyPersonalAssembly'.

    How to obfuscate this also ??

    Regards,

    La Richesse & la Gloire ne griseront jamais que les temples...
  • Re: Use NGEN with WebDeployment

    07-23-2008, 6:33 AM
    Answer

    Hi,

    Thanks for your response.

    You can use full path such as "D:\FolderName\dotfuscator.exe" to avoid error 9009.

    To question 2, you can try to use " -q" switch which tells Dotfuscator to run completely without printed output. This is suitable for inclusion into application build sequences. This option overrides verbose mode. You can refer to http://msdn.microsoft.com/en-us/library/ms227238(VS.80).aspx.

    To protect some elements of web.config, you can try to encrypt it using Aspnet_regiis.exe. For more information, see http://msdn.microsoft.com/en-us/library/ms998280.aspx

     

    I look forward to receiving your test results.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Use NGEN with WebDeployment

    07-23-2008, 9:59 AM

    1. - OK: I use full path and it's workng fine now

     

    2. - FAILED: I have tried option -q (as you suggest) and/or /q but the report at the end still appear. Otherwise, I have no other ouput. When I click on ok to close the report, the package installation continue and finish to build. See my screenshot: http://ckhdk.free.fr/upload_test/upload/dotfuscator.jpg

     => "C:\Program Files\Microsoft Visual Studio 8\Application\PreEmptive Solutions\Dotfuscator Community Edition\dotfuscator.exe" -q C:\myproject\dotfuscator_Console.xml

     

    3. - OK: I have check documentation that you provide to crypt web.config but I want to obfuscate and not to crypt (with dotfuscator Community 3.0). The problem is that my class has been transform to myClass -> f  all over the code, so in the web.config I should write f (if I'm using the obfuscated code). So, finally I don't obfuscate the class that is mentioned in my web.config and it's working fine (of course) :) I don't know to replace the (constant) string in the web.config. In fact, after some test, my application is globally working but I have the same kind of problem with the following instructions:

    e.GetType ().Name == "myClassException"

    or

    myEnumaration.X.ToString()

    These both instructions are to avoid if you want to use obfuscation. Does someone has good advice of best practice to be compatible with dotfuscator ?

     

    Thanks for solutions - I still need a good advice for problem 2. :)

    Regards,

    La Richesse & la Gloire ne griseront jamais que les temples...
  • Re: Use NGEN with WebDeployment

    07-23-2008, 11:35 PM

    Hi,

    For the problem 2, I believe that the best answer to this question is to contact PreEmptive (http://www.preemptive.com/dotfuscator-faq.html).

     

    I hope this helps.

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Use NGEN with WebDeployment

    07-29-2008, 5:57 AM

    I have received the answer to point 2 from pre-emtpive them self and.. it is interresting... :)

     

    Hi,

    Normally we do not provide live support to Community Edition users.
    However I will answer your question.
    The obfuscation report dialog generated by the Community Edition cannot be disabled.
    However in the Professional Edition, there is no obfuscation report dialog.
    If you would like try an evaluation of Dotfuscator Professional Edition, you can request an evaluation here:
    http://www.preemptive.com/request-an-evaluation.html
    With that said, I will close the case.

    Regards,
    PreEmptive Support

     

    Thank you pre-Emptive !


    La Richesse & la Gloire ne griseront jamais que les temples...
Page 1 of 1 (7 items)
Microsoft Communities
Page view counter