# LC Task in .NET Core Projects

> The license compiler (lc.exe) is compiling the licenses of referenced components into the resources of a created assembly. In some versions of .NET Core, the LC task is not supported or fails. This article explains how to compile the licenses successfully.

- **Author:** Bjoern Meyer
- **Published:** 2020-04-29
- **Modified:** 2026-07-17
- **Description:** In some versions of .NET Core, the LC task is not supported or fails. This article explains how to compile the licenses successfully.
- **2 min read** (315 words)
- **Tags:**
  - ASP.NET
  - .NET Core
- **Web URL:** https://www.textcontrol.com/blog/2020/04/29/lc-task-in-dotnet-core-projects/
- **LLMs URL:** https://www.textcontrol.com/blog/2020/04/29/lc-task-in-dotnet-core-projects/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2020/04/29/lc-task-in-dotnet-core-projects/llms-full.txt

---

In .NET projects, licenses of referenced, licensed assemblies are compiled into the resources of the calling application assembly. For Windows Forms and WPF applications, these are the created EXE files and for web applications (both .NET 4.x and .NET Core), the licenses are embedded in the application's main DLL.

In older versions of Visual Studio 2019 (< version 16.5.4), the LC task was not part of the MSBuild process ([\#2006](https://github.com/microsoft/msbuild/issues/2006)). The result was that licenses, even if the *licenses.licx* file is included as an embedded resource, were not compiled into the application.

This changed in newer versions of Visual Studio 2019 and Visual Studio 2019 Preview. In new versions including the most current version 16.5.4 (Visual Studio 2019) and 16.6.0 Preview 4.0 (Visual Studio 2019 Preview), the LC task is executed on compiling the application.

But unfortunately, that doesn't mean that this works. In many cases, this error is shown while compiling:

*MSB6003 The specified task executable "lc.exe" could not be run. System.ComponentModel.Win32Exception (0x80004005): The filename or extension is too long*

Affected are .NET Core 2.0, 3.0 and 3.1 applications in all Visual Studio 2019 versions including Preview versions. For .NET 5, this problem is solved (at least in Visual Studio 2019 Preview). So, fingers crossed for the final release of .NET 5 in November 2020 that Microsoft keeps it as is and fixes this for .NET Core applications < 5.

To [workaround](https://github.com/Microsoft/msbuild/issues/2836#issuecomment-404559473) this error, you can add the following groups to your project file (*.csproj*) of your application:

```
<Target Name="WorkaroundMSBuild2836" BeforeTargets="CompileLicxFiles">
    <PropertyGroup>
      <_OriginalTargetFrameworkVersion>$(TargetFrameworkVersion)</_OriginalTargetFrameworkVersion>
      <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    </PropertyGroup>
  </Target>
  <Target Name="UndoWorkaroundMSBuild2836" AfterTargets="CompileLicxFiles">
    <PropertyGroup>
      <TargetFrameworkVersion>$(_OriginalTargetFrameworkVersion)</TargetFrameworkVersion>
    </PropertyGroup>
  </Target>
```

In this case, temporarily, another framework target version is used for the LC task.

The table below shows the differences in various .NET Core versions and indicates whether a workaround is required or not:

| Visual Studio Version | .NET Core 2.0 | .NET Core 3.0 | .NET Core 3.1 | .NET Core 5 |
|---|---|---|---|---|
| Visual Studio 2019   ( >= 16.5.4 ) | &check; \* | &check; \* | &check; \* | N/A |
| Visual Studio 2019 Preview 4   ( >= 16.6.0 ) | &check; \* | &check; \* | &check; \* | **&check;** |

\* Workaround required

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [ASP.NET Core: Deploying the TX Text Control 32.0 SP2 Document Editor to Linux](https://www.textcontrol.com/blog/2024/01/22/deploying-tx-text-control-to-linux/llms.txt)
- [ASP.NET Core: Deploying the TX Text Control Document Viewer to Azure App Services](https://www.textcontrol.com/blog/2022/11/29/deploying-document-viewer-to-linux/llms.txt)
- [Visual Studio 2022 and .NET 5, 6 and 7 (Preview) Support and Strategy](https://www.textcontrol.com/blog/2022/08/11/visual-studio-2022-net-5-6-7-support-and-strategy/llms.txt)
- [2021 Wrap Up - Rethinking Documents](https://www.textcontrol.com/blog/2021/12/22/2021-wrap-up-rethinking-documents/llms.txt)
- [ASP.NET Core: Deploying the TX Text Control Document Viewer to Azure App Services](https://www.textcontrol.com/blog/2021/11/08/deploying-document-viewer-to-linux/llms.txt)
- [ASP.NET Core: Deploying the TX Text Control Document Editor to Linux](https://www.textcontrol.com/blog/2021/10/29/deploying-tx-text-control-to-linux/llms.txt)
- [Announcing TX Text Control Support for .NET 5](https://www.textcontrol.com/blog/2021/05/04/announcing-tx-text-control-support-for-dotnet-5/llms.txt)
- [Angular DocumentViewer: Loading Documents from an ASP.NET Core Backend Web API](https://www.textcontrol.com/blog/2020/06/08/angular-documentviewer-loading-documents-from-backend/llms.txt)
- [Building an Angular Application with an ASP.NET Core Back-End](https://www.textcontrol.com/blog/2020/05/06/building-an-angular-application-with-an-aspnet-core-backend/llms.txt)
- [ASP.NET Core: Server-Side MailMerge](https://www.textcontrol.com/blog/2020/04/28/aspnet-core-server-side-mailmerge/llms.txt)
- [Creating an ASP.NET Core Web Application using TXTextControl.Web](https://www.textcontrol.com/blog/2020/04/24/creating-an-aspnet-core-web-application-using-txtextcontrolweb/llms.txt)
- [TXTextControl.Web for ASP.NET Core Web Applications Released](https://www.textcontrol.com/blog/2020/04/24/textcontrol-for-aspnet-core-web-released/llms.txt)
- [DocumentViewer for .NET Core 3.1 Released](https://www.textcontrol.com/blog/2020/04/08/documentviewer-for-dotnet-core-released/llms.txt)
- [Using TX Text Control in ASP.NET Core 3.0 Web Applications](https://www.textcontrol.com/blog/2019/09/16/using-tx-text-control-in-asp-net-core-3-web-applications/llms.txt)
- [ReportingCloud .NET Core Quickstart Tutorial](https://www.textcontrol.com/blog/2019/07/24/reportingcloud-dotnet-core-quickstart-tutorial/llms.txt)
- [AI Natural Language Document Generation with MCP and TX Text Control .NET](https://www.textcontrol.com/blog/2026/07/16/ai-natural-language-document-generation-with-mcp-server-and-tx-text-control-dotnet/llms.txt)
- [WeAreDevelopers World Congress Europe 2026 Wrap Up: Record Breaking Days in Berlin](https://www.textcontrol.com/blog/2026/07/13/wearedevelopers-world-congress-europe-2026-wrap-up-record-breaking-days-in-berlin/llms.txt)
- [C# Document Generation: A Developer's Guide for .NET](https://www.textcontrol.com/blog/2026/07/08/csharp-document-generation-developer-guide-for-dotnet/llms.txt)
- [Validating PDF/UA Documents in .NET C#: A Practical Guide](https://www.textcontrol.com/blog/2026/07/06/validating-pdf-ua-documents-in-dotnet-csharp/llms.txt)
- [See Text Control at WeAreDevelopers World Congress Europe 2026 in Berlin](https://www.textcontrol.com/blog/2026/07/06/see-text-control-at-wearedevelopers-world-congress-europe-2026-in-berlin/llms.txt)
- [DWX 2026 Wrap-Up: Four Days of Innovation, Conversations, and Enterprise Document Solutions](https://www.textcontrol.com/blog/2026/07/03/dwx-2026-wrap-up-four-days-of-innovation-conversations-and-enterprise-document-solutions/llms.txt)
- [Create SignFabric Envelopes from Mail Merge Templates in .NET C#](https://www.textcontrol.com/blog/2026/06/23/create-signfabric-envelopes-from-mail-merge-templates-using-dotnet-csharp/llms.txt)
- [Convert SSRS RDL Reports to DOCX and TX Text Control Templates in .NET C#](https://www.textcontrol.com/blog/2026/06/22/convert-ssrs-rdl-reports-to-docx-and-tx-text-control-templates-in-dotnet-csharp/llms.txt)
- [Export Document Tables to CSV in .NET C#](https://www.textcontrol.com/blog/2026/06/19/export-document-tables-to-csv-in-dotnet-csharp/llms.txt)
- [Major SignFabric Updates: Stronger Audit Trails, Validation, and Recipient Workflows](https://www.textcontrol.com/blog/2026/06/17/major-signfabric-updates-stronger-audit-trails-validation-and-recipient-workflows/llms.txt)
