views:

1151

answers:

2

Does anyone know how to disable authenticode signature verification in a .NET executable (to avoid slow startup) without using an application config file? In other words, do this:

<configuration>
    <runtime>
        <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>

without an app.config. Is it possible?

A: 

Well, according to MSDN the element generatePublishersEvidence can only be used in a configuration file:

Configuration File

This element can be used only in the application configuration file.

See http://msdn.microsoft.com/en-us/library/bb629393.aspx.

0xA3
+1  A: 

If you are allowed to modify the Main() method, then what you could do is the following in your Main:

  1. Create an application config file in memory with generatePublisherEvidence
  2. Create a new application domain using the newly created application config file
  3. Run the original Main in the other application domain

This will allow you not to have an application config file, but be able to have all the customization you would want to have in the application config file.

earlNameless