BorgRebel
BorgRebel

Reputation: 518

"Could not find file" when precompiling website in Visual Studio 2013

When trying to publish a web site (not application) in Visual Studio 2013 I am receiving the error:

Error 80 Could not find file 'C:\Users\xxx\AppData\Local\Temp\2\Temporary ASP.NET Files\sourcecode\f4add76e\ed4d53d8\App_Web_0ttpvjhk.0.vb'.

If I deploy the website without precompiling it works fine. Also, when running the website locally I (and other team members) have to rebuild several times before it will compile without errors. The errors we receive when trying to run locally usually have to do with duplicate new subs being generated, by Visual Studio, from data table/table adapter xsd files.

I've tried compiling via the command line (aspnet_compiler) to rule out Visual Studio and receive the same error. Any ideas would be most appreciated as we've been trying everything we can think of to solve the issue.

Thank you.

Edit 1

Here is a common error when trying to build the web site locally. Sometimes it builds fine, other times we get an error like this:

Error 81 The file name 'C:\Users\xxxx\AppData\Local\Temp\2\Temporary ASP.NET Files\root\25143ee9\2d39f4f7\ymvk4bug.pdb' was already in the collection.

Upvotes: 1

Views: 769

Answers (1)

BorgRebel
BorgRebel

Reputation: 518

I ended up finding out what was causing the problem.

I had upgraded from ReportViewer 10 to ReportViewer 11 and the following line was added to the web.config:

<buildProviders>
   <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</buildProviders>

This was causing the intermittent build failures. I removed the buildProvider tag and it builds and precompiles just fine.

Upvotes: 1

Related Questions