views:

723

answers:

4

My current web app works fine locally and on live, what i am currently playing around with is compiling my Web App with the Visual Studio Option "Add Web Deployment Project" so all the code behind is compiled into DLL's.

There's is one particular build error i can not get rid off

Error 50 The type or namespace name 'usercontrols_calendarcell_ascx' does not exist in the namespace 'ASP' (are you missing an assembly reference?) c:\page.ascx.cs 30 1 test_deploy

And the actual line of code is as follows :

protected ASP.usercontrols_calendarcell_ascx[] calendarCells;
A: 

I am guessing here, but it looks like your calendarcell user control is not compiling properly.

When this happens your deployment project is probably using an old dll that does not contains that class.

Try to compile you project, and when you are able to do that with no errors compile the deployment project.

Sergio
A: 

You need to make sure that you compile page.ascx.designer.cs as well.

OJ
A: 

Do you have it correctly referenced in in the aspx page?

I mean this part

<%@ Register TagPrefix="cdl" Src="~/usercontrols/usercontrols_calendarcell_ascx" TagName="sideLeft" %>

(Should be a similar tag in your aspx page and the SRC should refer to where the calendar control is.

Cyril Gupta
+2  A: 

The problem comes from the fact that the namespace ASP is a 'pseudo' namespace, which can't be referenced when compiling.

The solution I found was to actually integrate the current namespace into the usercontrol definition. I adapted the names of the elements to your naming conventions, but I don't know anything about the namespace you used. Therefore I just named it 'Project.NameSpace'.

  1. In the calendarcell.ascx file:

    <%@ Control Language="C#" AutoEventWireup="true" Codefile="calendarcell.ascx.cs" Inherits="Project.NameSpace.usercontrols_calendarcell" %>

  2. In the calendarcell.ascx.cs file:

    namespace Project.NameSpace
    {
    public partial class usercontrols_calendarcell : System.Web.UI.UserControl
    {

  3. In the page.ascx.cs file:

    using Project.NameSpace;

Hope this helps. In my case it did the trick perfectly.

Damian Vogel