4
votes

Problem

A .lic file which is in the root of the ASP.NET Web Application is not deployed to Azure Web App during VS 2015 Publish operation. The .lic file set as "Content"

Context

I have a component in my ASP.NET MVC which requires its .lic file in the web application root. I am using VS 2015 Built in Publish to deploy my web app to Azure as an Azure Web App Service. The .lic file is added to the ASP.NET MVC Web project as a "Content". However the .lic file is not published. (checked via FTP)

Question

How can I publish this .lic file to the Web App Service root? (of course I can manually copy it via ftp, but that's not a solution in long term)

More Diagnostics

I've created a Hello.txt file in my project in the root. All settings the same, the Hello.txt is published. It seems that the VS 2015 Publish ignores .lic files... Is it possible? How to overcome?

1
Right click on the file and inside properties window check if copy to output is set to copy always. This should copy to output directory. - Mitul
The output directory is the /bin. I must have the file in the root /. Btw I tried. the build copied it to the /bin, but the deploy still ignores it. (checked via ftp) It seems maybe the .lic extension is ignored... - g.pickardou
Set the build action in the properties for the file to be None and try publishing again. - Mitul
Does not work. Please read my added "More Diagnostics" too - g.pickardou

1 Answers

0
votes

Add to web.config:

<system.web>
  <compilation>
    <buildProviders>
      <remove extension=".lic"/>
      <add extension=".lic" type="System.Web.Compilation.ForceCopyBuildProvider"/>
    </buildProviders>
  </compilation>
</system.web>