.NET Core MSBuild is missing the LC task
See original GitHub issueFrom @livarcocc on Monday, April 24, 2017 5:08:10 PM
From @alienisty on April 24, 2017 1:58
Steps to reproduce
Just create a project with a licenses.licx file definition and build the project with
dotnet build project.csproj
Expected behavior
The project builds and the license information are compiled in the binaries
Actual behavior
The following error is raised:
C:\Program Files\dotnet\sdk\1.0.3\Microsoft.Common.CurrentVersion.targets(2977,5): error MSB4062: The “Microsoft.Build.Tasks.LC” task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> decl aration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. 0 Warning(s) 1 Error(s)
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.3)
Product Information: Version: 1.0.3 Commit SHA-1 hash: 37224c9917
Runtime Environment: OS Name: Windows OS Version: 6.3.9600 OS Platform: Windows RID: win81-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.3
Copied from original issue: dotnet/cli#6389
Copied from original issue: microsoft/msbuild#2006
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:35 (12 by maintainers)

Top Related StackOverflow Question
There already is no (working) licensing in .NET Core, some fractions of the old infrastructure remain working, but as a whole it does not work even now. Its a longstanding open issue. Considering its not even officially possible yet to develop custom controls its not a major issue.
The deprecation of BF will be much more catastrophic to the Clipboard and Drag and Drop systems though if/when it gets deprecated there as well, these require it and I’m not aware of a plan for a replacement. (Though maybe there are internal plans not made public yet?)
For anyone is the same boat I am currently in with migrating older code containing components that use the license.licx runtime licensing model towards dotnet core and wanting to use “dotnet build” here is the workaround that I am using.
Caveat; it works for me, YMMV.
now you can build using dotnet build without getting “error MSB4062: The “Microsoft.Build.Tasks.LC” task could not be loaded from the assembly Microsoft.Build.Tasks.Core” and with proper runtime licences embedded.
This may become tedious if you are regularly changing the components/versions etc. and your licenses.licx files changes but for me the components using the licenses.licx model have not changed in a number of years so neither has my licenses.licx file and I don’t expect it to change anytime soon, more likely they’ll eventually be replaced by something that does not need licenses.licx entries.