File not found when creating web deployment project

I have a web deployment project that creates and buttons a web application project. I get a lot of errors when I create WDP as follows:

Error 73 The file '/Foo.csproj/Properties/Administration/Modules/ACL.ascx' does not exist. /Foo.csproj/Properties/Administration/ACL.aspx

Error 74 Unknown server tag 'foo: ACL' ./ Foo.csproj / Properties / Administration / ACL.aspx

These errors come from the Web Deployment Project, not the WAP. Errors always follow the same pattern: first, an .ascx error is detected, and then a related error indicating that the server tag associated with the previous ascx is unknown (this obviously makes sense).

There are no errors or warnings in ascx or aspx.

Controls are registered using the <%@ Register %> (as opposed to registering in web.config)

What can cause such a symptom?


UPDATE

Errors come from aspnet_compiler.exe , which starts with the following command:

C: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_compiler.exe -v "/Foo.csproj" -p "C: \ Projects \ Foo \ Foo" -u -f -d obj \ Staging \ TempBuildDir

and produces the following errors:

Utility for precompiling an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved. /Foo.csproj/Properties/Administration/ACL.aspx(5): ASPPARSE Error: The file '/Foo.csproj/Properties/Administration/Modules/ACL.ascx' does not exist.
/Foo.csproj/Properties/Administration/ACL.aspx(7): ASPPARSE error: Unknown server tag 'foo: ACL'.

in foo.csproj ACL.aspx is declared as

 <Content Include="Administration\ACL.aspx" /> <!-- Snip --> <Compile Include="Administration\ACL.aspx.cs"> <DependentUpon>ACL.aspx</DependentUpon> <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="Administration\ACL.aspx.designer.cs"> <DependentUpon>ACL.aspx</DependentUpon> </Compile> 

and ACL.ascx as

 <Content Include="Administration\Modules\ACL.ascx" /> <!-- Snip --> <Compile Include="Administration\Modules\ACL.ascx.cs"> <DependentUpon>ACL.ascx</DependentUpon> <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="Administration\Modules\ACL.ascx.designer.cs"> <DependentUpon>ACL.ascx</DependentUpon> </Compile> 

I cannot figure out where the /Properties/ paths element is from the paths in error! It is not in the project file and is not served on aspnet_compiler.exe .

The solution file and the project files are identical (apart from the project names) for the working solution.

+7
source share
3 answers

I faced the same situation in the project at my desk, and here is my solution:

 //doesn't work <%@ Control Language="C#" AutoEventWireup="true" Inherits="Controls_CatalogCustomerORW" CodeFile="CatalogCustomerORW.ascx.cs" %> //does work <%@ Control Language="C#" AutoEventWireup="true" Inherits="Controls_CatalogCustomer" Codebehind="CatalogCustomer.ascx.cs" %> 

The error seems to be always subtle CodeFile vs CodeBehind

+8
source

I saw something similar to this (my recollection is admittedly a bit foggy!) When the Create Action option for the file is set to None , not Content . To find out if there is a problem:

  • Right-click the file that is in question in Solution Explorer and select Properties
  • Look at the "Build Action" for the file if it tells None fix it before Content .

Another possibility is that something went wrong in your .csproj , since the path to ACL.ascx looks clearly weird. Should it be under /Foo.csproj/Properties/ ? If my first sentence does not help, I suggest trying the following:

  • Right-click on Foo.csproj in Solution Explorer and select Unload Project
  • After the download is complete, right-click on Foo.csproj (Unavailable) in the Solution Explorer and select Edit Foo.csproj
  • Locate ACL.ascx and compare the XML markup for this file with another “good” file that does not generate an error. There is probably a subtle difference that causes the error.
+2
source

I was getting a similar error.

My situation was as follows:

 root/page.aspx root/page.aspx.cs root/page.aspx.designer.cs root/X/page.aspx 

for some reason, someone copied the page.aspx file to folder X and even deleting the file from my web application project, the deployment project still had problems. I also noticed that even with a different name (for example, a copy of page.aspx in the x folder, the problem will still occur).

It only worked when I deleted the page.aspx file (or any other name) from the X folder.

+1
source

All Articles