Monday, 13 March 2017

Fix - Error in lc.exe when Compiling Solution upgraded to Visual Studio 2017 RTM from Visual Studio 2015

Upgraded our product solution today to the latest Visual Studio 2017 RTM and everything seemed to work fine - until I started getting the following error in the build:

"The specified task executable "lc.exe" could not be run. The filename or extension is too long"

What is this lc.exe command and why is it running? It is used by the standard .NET licensing mechanism and is maintained by Visual Studio for information about all licensed components.

In my case, the error was occurring in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" Line 2975 according to my error log.

Clearly this problem was related to the fact we are using Telerik Controls which require a licx file to compile (or so I thought).

I turned on full diagnostics in Visual Studio 2017 to help get to the bottom of the issue:




This showed the full path that was being passed to lc.exe is over 42000 characters long (!):
1> C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\lc.exe /target:ESSP.ApplicationPages.dll /complist:Properties\licenses.licx /outdir:obj\Debug_SP2013\ ....[SNIP]
 


Several places such as on Microsoft Connect - suggested that the "solution" (pardon the pun) is just to delete the licx file (also as per http://docs.telerik.com/devtools/aspnet-ajax/licensing/license-file) I could then recompile without any build exceptions.

This issue comes about because the lc.exe executable can only handle a parameter length of 32000 characters or less - and the full path is used for all references. Needless to say this is a restrictive limitation in the licensing mechanism!

So the possible alternatives to fix this issue:
1) Remove the licx file if possible when you don't need the full licensed functionality (in my case this was fine - as we don't need design mode for the Telerik controls).
2) Reduce the length of your references by adding a shared drive or logical redirect to a shorter path e.g. c:\references instead of c:\src\DDK\product name\releases\ etc)
3) Reduce the number of references that you have in the project that has issues with lc.exe

DDK

10 comments:

Unknown said...



Thanks admin for sharing the unique content, you have done a great job

Installment loans in Mississippi
Payday loans in Mississippi
Title loans in Mississippi

sachin.ogeninfo said...

Cattle feed Bags supplier
Rice Bags Manufacturers
dry fruit pouches manufacturers

sachin.ogeninfo said...

website designing company in Gurgaon
ppc services in gurgaon

Teena Aggarwal said...

pouch manufacturers
wall putty bag manufacturers

Teena Aggarwal said...

iso certification in noida
iso certification in delhi
Halal Certification in Delhi
haccp certification in delhi

شوشو said...

شركة عزل الاسطح بالخبر
شركة كشف تسربات المياه بعنك
شركة كشف تسربات المياه بسيهات
شركة مكافحة النمل الابيض بالقطيف

Alisah Wilson said...

Our top experts have all the knowledge and experience in all studies and they offer high-quality content in their assignment help so that students can score better grades.
assignment help
online assignment help cheap

meldaresearch said...

Unsure which firm produces Best Custom Research Paper Writing Services in the industry to solve your writing needs? Legitimate Custom Research Paper Services is there for your to produce the best Research Paper Help Assistance Services.

hrroman said...

If you are stuck with your Management assignment then in this case you can opt for our Management Assignment. we provide the bestMarketing assignment help.We also provideConsumer Behaviour Assignment Help for students across the globe. for more information contact us +16692714848.

meldaresearch said...

It is important for cultural studies coursework writing service students to seek Cultural Studies Writing Services from a reputable cultural studies assignment writing service provider for their cultural studies research paper services.