适用于c#的Azure Storage 2.0客户端使用Microsoft.Data.OData库。问题是在build中,我在build文件夹中找到:
bin/de/Microsoft.Data.Edm.resources.dll
bin/de/Microsoft.Data.OData.resources.dll
bin/de/Microsoft.Data.Services.Client.resources.dll
bin/de/System.Spatial.resources.dll
bin/es/Microsoft.Data.Edm.resources.dll
bin/es/Microsoft.Data.OData.resources.dll
bin/es/Microsoft.Data.Services.Client.resources.dll
bin/es/System.Spatial.resources.dll
等,用于语言de,es,fr,it,ja,ko,ru,zh两次
这使得我想我发送给Azure Cloud实例的包中大约有3.2Mo的库是无用的。我喜欢把我的包裹寄得最轻、最快。
我的应用程序设置为使用文化默认值和文化FR-FR
排除所有其他语言是安全的吗?我如何在构建时实现这种排除?
这是我的webconfig
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.1.0" newVersion="5.6.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
发布于 2014-12-10 03:58:17
您可以做的一件事是修改.csproj
文件,挂接到AfterBuild
事件中,然后删除除所需语言之外的所有文件夹。不是最优的,但它应该可以工作。类似于:
<Target Name="AfterBuild">
<ItemGroup>
<DirsToClean Include="$(OutDir)\de;$(OutDir)\es;..." />
</ItemGroup>
<RemoveDir Directories="@(DirsToClean)" />
</Target>
至于是否可以安全地排除...不知道。:)
https://stackoverflow.com/questions/27026436
复制相似问题