Mixed mode assembly is built against version v2.0.50727 of the runtime
This article helps you resolve the problem where you fail to build Microsoft .NET Framework 3.5 or lower projects on .NET Framework 4.0 MSBuild or team build where references require Serializer Generator (SGEN).
Original product version: .NET Framework 3.5, 4.0
Original KB number: 2572158
Symptoms
You may receive the following error when you build .NET Framework 3.5 or lower projects on .NET Framework 4.0 MSBuild or team build where references require Serializer Generator (SGEN):
SGEN: 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.
Cause
To use mixed mode assemblies in .NET Framework 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>
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for