Share via


Building project in release mode with projects that contain license.licx throws 'could not find file' error on Visual Studio 2015

Question

Wednesday, July 22, 2015 9:47 PM | 1 vote

I'm having trouble building my projects in Release mode that have licenses.licx files.  I get the error below when i build on Visual Studio 2015:

Error reading resource '<ProjectName>.dll.licenses' -- 'Could not find file '<directory><ProjectName>.dll.licenses'.'

All replies (8)

Thursday, July 23, 2015 8:47 AM

Hi PolyBSCoder,

Does it work for previous VS versions?

As far as I know, when VS is building the project, Lc.exe will detect the licenses.licx files that work as the embeded resource of the project, then generate .licenses file which provides support for licensing. This .licenses file will then be embeded into the project's output assembly. As per your description, the Lc.exe failed to generate the .licenses file. So make sure the licenses.licx is in the project's properties and set to Embeded Resource. By default, when you use some licensing controls, VS will automatically create the .licx file for us.

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.


Thursday, July 23, 2015 2:33 PM

Yes it did before i upgraded my Visual Studio to 2015.  The only change i did after upgrading, was change the .net framework to 4.6 and use some of the new language features in C# 6.0.  

Yes the licenses.licx file is in the properties section and set as an embedded resource.  I removed it and autgenerated a new licenses.licx file, but still get the same issue.  


Thursday, July 23, 2015 3:55 PM

I have a similar problem which I posted in this forum and added an excerpt from the log file.  

Is your log similar to this?

<entry>
    <record>3421</record>
    <time>2015/07/22 20:43:02.645</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>AppId stopped registry detouring</description>
  </entry>
  <entry>
    <record>3422</record>
    <time>2015/07/22 20:43:02.645</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Shutting down pkgdef registry</description>
  </entry>
  <entry>
    <record>3423</record>
    <time>2015/07/22 20:43:02.645</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Released pkgdef cache usage tracker</description>
  </entry>
  <entry>
    <record>3424</record>
    <time>2015/07/22 20:43:02.645</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>PkgDef registry shutdown complete</description>
  </entry>
< /activity> 


Monday, August 24, 2015 4:32 PM

Sorry i don't have the files anymore.  My solution was to recreate each project in Visual Studio 2015, copied the xml out of the csproj file and pasted it in the .csproj files that had the issues.  The reason i copied the xml was because they are in TFS and I didn't want to loose my change history by adding a new project to tfs.


Thursday, August 27, 2015 12:09 AM | 2 votes

I am having very similar problem too. I think its issue with the MSBuild Tools 2015 installation and its missing some of the target files which are part of the complete install of Visual Studio and hence the issue does not present itself on development machine where Visual Studio 2015 is installed. I tried to cheat and copy files from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0 in local machine to build machine in an attempt to make all targets on dev machine available on build server but did not help.

After days of google and reading forums, I found the solution. I had to install Windows 10 SDK which targets .NET 4.6 framework. I remember now that I had to install 8.1 SDK the last time when I switched the framework to 4.5.1. 

It's so obscure error perhaps the suggestion would be to make error more user friendly. But I could say the same a lot of build errors which is kinda obscure and you can only resolve after someone have spend a lot of time researching it.


Thursday, November 26, 2015 9:52 AM

Thank you so much! We also had this problem on our build server and installing the SDK fixed the error for us :)


Saturday, April 30, 2016 12:59 PM | 2 votes

I had this and noticed that the filename in the error message was always lower case. I changed my assembly name to lower case and suddenly the file could be found and the build continued normally.

Only seems to be an issue with framework 4.6


Thursday, June 9, 2016 2:01 PM

I had this and noticed that the filename in the error message was always lower case. I changed my assembly name to lower case and suddenly the file could be found and the build continued normally.

Only seems to be an issue with framework 4.6

Bang on.  This does indeed appear to be the issue - modifying the "Assembly name" property in the Project's Properties to ensure it is all lower case has fixed this for us (without installing any SDKs).