Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set generatePublisherEvidence false as default

Tags:

c#

winforms

generatePublisherEvidence will cause a long startup time in some cases, and I would like to turn it off.

With app.config, I could deal with it by below.

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

Though accomplishable, it looks redundant. It is more natural that generatePublisherEvidence is turned false by default. In other words, no app.config is required. But I could not find any setting about it in Visual Studio 2012.

Any help?


1 Answers

The reason you need to turn it off is because the .NET framework turns it on by default. The documentation is clear on that.

However, please also take note to this:

In the .NET Framework 4 and later, this element has no effect on assembly load times. For more information, see the "Security Policy Simplification" section in Security Changes in the .NET Framework.

That's from the same documentation link. If you can upgrade to .NET 4+ you're good leaving it on.

like image 102
Mike Perrenoud Avatar answered Oct 30 '25 20:10

Mike Perrenoud