首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >我可以从构建中排除Microsoft.Data.OData语言资源吗?

我可以从构建中排除Microsoft.Data.OData语言资源吗?
EN

Stack Overflow用户
提问于 2014-11-20 04:32:42
回答 1查看 3.8K关注 0票数 22

适用于c#的Azure Storage 2.0客户端使用Microsoft.Data.OData库。问题是在build中,我在build文件夹中找到:

代码语言:javascript
复制
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

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2014-12-10 03:58:17

您可以做的一件事是修改.csproj文件,挂接到AfterBuild事件中,然后删除除所需语言之外的所有文件夹。不是最优的,但它应该可以工作。类似于:

代码语言:javascript
复制
<Target Name="AfterBuild">
  <ItemGroup>
    <DirsToClean Include="$(OutDir)\de;$(OutDir)\es;..." />
  </ItemGroup>
  <RemoveDir Directories="@(DirsToClean)" />
</Target>

至于是否可以安全地排除...不知道。:)

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27026436

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档