第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

MSBuild。在構(gòu)建之前創(chuàng)建 EmbeddedResource

MSBuild。在構(gòu)建之前創(chuàng)建 EmbeddedResource

C#
守候你守候我 2021-11-07 19:54:30
我想在編譯主單元之前在程序集中嵌入本地引用。但是寫的目標(biāo)不起作用。  <Target Name="EmbedLocal" BeforeTargets="CoreCompile">    <Message Text="Run EmbedLocal for $(MSBuildProjectFullPath)..." Importance="high"/>        <ItemGroup>      <EmbeddedResource Include="@( ReferencePath->WithMetadataValue( 'CopyLocal', 'true' )->Metadata( 'FullPath' ) )"/>    </ItemGroup>    <Message Text="Embed local references complete for $(OutputPath)$(TargetFileName)." Importance="high" />  </Target>@(EmbeddedResource) 此時(shí)包含有效的路徑列表。更新:現(xiàn)在我的導(dǎo)入文件包含:<Project ToolsVersion="$(MSBuildToolsVersion)" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <PropertyGroup>    <EmbedLocalReferences Condition=" '$(EmbedLocalReferences)' == '' ">True</EmbedLocalReferences>  </PropertyGroup>  <Target Name="EmbedLocal" BeforeTargets="ResolveReferences" Condition=" '$(EmbedLocalReferences)' == 'True' ">    <Message Text="Run EmbedLocal for $(MSBuildProjectFullPath)..." Importance="high"/>    <ItemGroup>      <EmbeddedResource Include="@(ReferenceCopyLocalPaths->WithMetadataValue( 'Extension', '.dll' )->Metadata( 'FullPath' ))">        <LogicalName>%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>      </EmbeddedResource>    </ItemGroup>       <Message Text="Embed local references complete for $(OutputPath)$(TargetFileName)." Importance="high" />  </Target></Project>它工作正常。輸出程序集包含所有 .dll 引用作為 EmbeddedResource。
查看完整描述

1 回答

?
慕村225694

TA貢獻(xiàn)1880條經(jīng)驗(yàn) 獲得超4個(gè)贊

MSBuild。在構(gòu)建之前創(chuàng)建 EmbeddedResource


您可以嘗試對(duì)csproj 文件使用BeforeBuild操作以包含嵌入的資源:


  <Target Name="BeforeBuild">

    ... 

    <ItemGroup>

      <EmbeddedResource Include="..."/>

    </ItemGroup>

    ...

  </Target>

現(xiàn)在 MSBuild 會(huì)將此文件作為嵌入資源添加到您的程序集中。


更新:


謝謝@Martin Ullrich。他指出了正確的方向,我們可以用<Target Name="EmbedLocal" BeforeTargets="PrepareForBuild">在Directory.Build.props來(lái)解決這個(gè)問(wèn)題。您可以檢查它是否適合您。


  <Target Name="EmbedLocal" BeforeTargets="PrepareForBuild">

    ... 

    <ItemGroup>

      <EmbeddedResource Include="..."/>

    </ItemGroup>

    ...

  </Target>


查看完整回答
反對(duì) 回復(fù) 2021-11-07
  • 1 回答
  • 0 關(guān)注
  • 377 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)