Reputation: 9
Can anyone help me im getting this error when im publishing my project on release mode
SGEN : error : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Please help me im stuck on this issue.
Upvotes: 1
Views: 1881
Reputation: 1573
There is an answer in Microsoft Support (https://support.microsoft.com/en-za/help/2572158/sgen-mixed-mode-assembly-is-built-against-version-v2-0-50727-of-the-ru) which says: In order to use mixed mode assemblies in 4.0, it must be configured in the configuration file for Sgen
Resolution
Add the information below to the sgen.exe.config file located at the following location: ..\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\
<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
</configuration>
For Visual Studio 2017 the path is different and can be like: c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
Upvotes: 0
Reputation: 9
For Build/Publish in Release Mode please follow below step
<?xml version ="1.0"?>
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Please keep this file in below path
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools Folder
And for x64
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64 Folder
Upvotes: -1