I've got a web deployment project that builds and zips a web application project. I am getting a lot of errors when I build the 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 are coming from the Web Deployment Project, not the WAP. The errors always follow the same pattern, first there is an error finding the .ascx and then an associated error saying the server tag related to the previous ascx is unknown (this obviously makes sense).
There are no errors or warnings in the ascx or aspx.
The controls are registered using a <%@ Register %>
tag (as opposed to being registered in the web.config)
What could be causing such a symptom?
UPDATE
The errors are coming from aspnet_compiler.exe
which is run 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 to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved. /Foo.csproj/Properties/Administration/ACL.aspx(5): error ASPPARSE: The file '/Foo.csproj/Properties/Administration/Modules/ACL.ascx' does not exist.
/Foo.csproj/Properties/Administration/ACL.aspx(7): error ASPPARSE: 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 can't understand where the /Properties/
element of the paths is coming from in the paths in the error ! It's not in project file and it's not being fed to aspnet_compiler.exe
.
The solution file and project files are identical (apart from project names) to a working solution.
I just came across this same situation in a project at my desk, and here was 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 appears to be the ever subtle CodeFile
vs CodeBehind
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With