.NET 3.5 ライブラリに sgen ビルド ステップがあります。VS2010 では、.NET 3.5 アプリからロードできない .NET 4 MyLib.XmlSerializers.dll が生成されます。ビルドステップを変更して正しいバージョンのアセンブリを取得する方法を知っている人はいますか? シリアライザ アセンブリとライブラリを単一の dll に IL マージすることは可能ですか?
これは私のsgenビルドステップです:
<Target Name="AfterBuild" DependsOnTargets="AssignTargetPaths;Compile;ResolveKeySource" Inputs="$(MSBuildAllProjects);@(IntermediateAssembly)" Outputs="$(OutputPath)$(_SGenDllName)">
<!-- Delete the file because I can't figure out how to force the SGen task. -->
<Delete Files="$(TargetDir)$(TargetName).XmlSerializers.dll" ContinueOnError="true" />
<SGen BuildAssemblyName="$(TargetFileName)" BuildAssemblyPath="$(OutputPath)" References="@(ReferencePath)" ShouldGenerateSerializer="true" UseProxyTypes="false" KeyContainer="$(KeyContainerName)" KeyFile="$(KeyOriginatorFile)" DelaySign="$(DelaySign)" ToolPath="$(SGenToolPath)">
<Output TaskParameter="SerializationAssembly" ItemName="SerializationAssembly" />
</SGen>
</Target>
ありがとう
編集:ここで同じ質問を見つけましたが、誰かがより良い解決策を持っているかどうかを確認するためにしばらく待ちます。