excel.exe.config

No VSTO prompts will be displayed.


<?xml version="1.0"?> 
<configuration>

// Enable .NET 2 run-time activation
<startup useLegacyV2RuntimeActivationPolicy="true">

// Enable the .NET Framework versions that should be available from within Excel.
<supportedRuntime version="v4.0.30319"/>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v1.1.4322"/>

// Enable provisioning of a newer .NET Framework version if an add-in requests a version that is not enabled above.
<process>
<rollForward enabled="true"/>
</process>

</startup>

// Enable Legacy CAS Policy
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>

</configuration>

useLegacyV2RuntimeActivationPolicy

Mixed mode assemblies are those compiled from C++/CLI.
In .NET 4.0 the way the runtime handles mixed mode assemblies has changed.
Any mixed mode assemblies cannot be loaded in .NET 4.0 runtime by default.
Adding this attribute will allow them to be run.


supportedRuntime

The supportedRuntime tag lets you force a particular COM component to use a specific framework version.
The first element should specify the most preferred version.
The last element should specify the least preferred version.
It will only load assemblies that have been built with this version of the .NET framework.
The .NET Framework 4.5 is an in-place update that replaces the .NET Framework 4 on your computer, and similarly, the .NET Framework 4.5.1 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1 are in-place updates to the .NET Framework 4.5, which means that they use the same runtime version, but the assembly versions are updated and include new types and members.
1.0 - "v1.0.3705"
1.1 - "v1.1.4322"
2.0, 3.0, 3.5 - "v2.0.50727"
4.0-4.7.1 - "v4.0"
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ee518876(v=vs.100)


rollforward

Excel 2010 allows the support of different versions of .NET.
Prior to 2010 / .NET 4.0 all COM components would run using the latest version of the .NET Framework that was installed.


NetFx40_LegacySecurityPolicy

Specifies whether the runtime uses legacy Code Access Security (CAS) policy.
In .NET 4.0 the policy component of CAS was made obsolete.
If you code continues to call policy types or members in any way you may encounter compilation warnings and runtime exceptions.
The solution is to migrate your obsolete calls to .NET 4.0
By including this line in the file the policy and evidence overloads will work as they did in previous versions of the .NET framework.
'https://docs.microsoft.com/en-us/dotnet/framework/misc/code-access-security-policy-compatibility-and-migration


Mixed Mode Assemblies

A mixed mode assembly is a dll that contains both managed code and native/MSIL code for a particular processor architecture.
Since it contains native code it can only be loaded into a process that matches the architecture the dll was compiled against.
This allows C++ code to be called from .NET code.
These types of assemblies were deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.



© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext