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

6 comments:

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

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.

Ravi chauhan said...

Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian

marriage certificate in ghaziabad
marriage certificate in noida
marriage certificate in gurgaon
marriage certificate in faridabad
marriage certificate in banglore
arya samaj mandir in ghaziabad
arya samaj mandir in noida
arya samaj mandir in gurgaon
arya samaj mandir in faridabad
arya samaj mandir in delhi

Health Lobby said...

Check the requirements for the criminal case law demanded by the Sindh High Court and feel free to consult advocate. Here you can find how to put the case in Sindh high Court.

venkatesh said...

4Movierulz telugu
Narappa Full Movie
Radhe Shyam Full Movie
Movierulz Plz 2021
Zee5 Premium account
Movierulz Plz
Tamilrockers Telugu
30 Rojullo Preminchadam Ela Full Movie Download
Ala Vaikunta puram Lo Full Movie Download
Vakeel Saab Full HD Movie Download
KGF Chapter 2 Movie Download
HIT Full Movie Download
Tamilyogi isaimini

Himanshi Dagar said...

Your article is very informative, thanks for this amazing post. I have also written some: Best Job Portal