The specified executable file for the task "LC.exe" cannot be started

I am developing a SharePoint 2013 solution using VS 2012, the solution has a licx file. I get a compile time error and warning.

Error: The specified task executable file "LC.exe" could not be started. The file name or extension is too long

A warning. The command line for the "LC" task is too long. Command lines longer than 32,000 characters may fail. Try to reduce the length of the command line by breaking the call on "LC" into several calls with fewer parameters for each call.

I tried using lc.exe.config <startup useLegacyV2RuntimeActivationPolicy="true"> I also tried moving the solution to "C: \", which was previously in the Projects folder.

I still cannot resolve this error.

+4
source share
5 answers

There is a workaround for MS support:

when you build a project, delete the license file from the project every time you get this error, just delete the license file

https://connect.microsoft.com/VisualStudio/feedback/details/779433/lc-exe-task-command-line-too-long

+2
source

Removing the license.licx file is not a solution. This will give you a runtime error if you use a third-party control that needs licenses.

LC.exe accepts the argument as a license file with the full path; if the argument is too long, it causes an error.

Therefore, save the file name and the path length shorter, it will compile and work.

+1
source

Deleting the license file did not help me. I end up deleting "license.licx" in the group Solution Explorer → Properties Awful that helps

0
source

This issue is fixed in VS2017 according to this GitHub check: https://github.com/Microsoft/msbuild/commit/e49717c727c3cab4db466bcb0a5abb624a8156bb I believe that the full version is VS2017 Update 2.

0
source

You can save a lot on the path length by creating a shortcut for the specific version of .NET you are using (in this case 4.5.2). Here are the steps:

  • run command prompt as administrator
  • Go to C: \ at the command prompt
  • mklink / J net452 "C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5.2"
  • Go to VisualStudio
  • Open project properties
  • Links Tab
  • Click the "Link Paths" button and add the path "C: \ net452"
  • Restructuring project
0
source

All Articles