--- lang: ja-jp breaks: true --- # MSBuild `dotnet build` では、`licenses.licx` ファイルの埋め込みリソースに対応していない 2022-07-04 ```shell= C:\Program Files\dotnet\sdk\7.0.100-preview.4.22252.9\Microsoft.Common.CurrentVersion.targets(3369,5): error MSB4803: タスク "LC" は .NET Core バージョンの MSBuild ではサポートされてい ません。.NET Framework バージョンの MSBuild をご使用ください。詳細については、https://aka.ms/msbuild/MSB4803 をご覧ください。 ``` > .NET Core MSBuild is missing the LC task #1462 > https://github.com/dotnet/winforms/issues/1462 > [Component Licensing] SDK needs to make sure that licenses.licx ends up as "EmbeddedResource" #3631 > https://github.com/dotnet/sdk/issues/3631 :::info msbuild コマンドによるビルドでは正常に動作する。 ::: :::info msbuild コマンドを使用しても、`TargetFramework`が`XXX-windows`の場合には対応していない。 ::: ## しょうがないので条件で分岐する。 ```xml= <ItemGroup Condition="'$(MSBuildRuntimeType)' == 'Full'"> <!-- `licenses.licx` を埋め込む lc.exe は、`dotnet build` で使用できない。 --> <EmbeddedResource Include="Properties\licenses.licx" /> </ItemGroup> <ItemGroup Condition="'$(MSBuildRuntimeType)' == 'Core'"> <None Include="Properties\licenses.licx"> <Pack>true</Pack> <PackagePath>contentFiles\any\$(TargetFramework_NetFramework)\Properties</PackagePath> </None> </ItemGroup> ``` ###### tags: `MSBuild` `dotnet build` `licenses.licx`
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.