Compiler Error when debugging ASP.NET (C#) project

Discussion in 'ASP .Net' started by JMnich, Feb 11, 2009.

  1. JMnich

    JMnich Guest

    Hello!

    I try to concentrate on the basic facts as I suppose my problem to be.

    I created a c# website having its own sitemapprovider. The code for the
    provider is located in a file in App_Code. The Provider makes calls to
    methods of other classes (i call them module-classes) to set up the menu
    structure. The code for each of the module-classes is lying in a different
    subdir of the root (!) folder - each in a different namespace. To get all
    necessary information for the menu from the module-classes I defined a Class
    representing one menu item and the methods of the module-classes return an
    array of this MenuItemClass depending on the users permissions for that
    module.

    So now here's the problem: If I generate the project (which i can) and
    publish it to a web server, everything works fine. If I try to debug the
    project locally (what I really would like to do!) I get the following error:

    CS0029: Eine implizite Konvertierung vom Typ
    "posy.web.controls.PosyMenuItem[]
    [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DLL]"
    in "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" ist nicht
    möglich.

    I try to translate: An implicit Conversion from type
    "posy.web.controls.PosyMenuItem[]
    [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DLL]"
    to "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" is not
    possible.

    The line affected is:

    posy.web.controls.PosyMenuItem[] tmpArray = tmpInit.GetPosyMenuItems();

    and tmpInit is defined as

    posy.web.modules.communication.Init tmpInit = new
    posy.web.modules.communication.Init();

    and in the Class-Definition for the class
    posy.web.modules.communication.Init the method is defined as

    public posy.web.controls.PosyMenuItem[] GetPosyMenuItems()

    Please help! I have no idea, what's going wrong here...

    Thanx,
    Juergen.
     
    JMnich, Feb 11, 2009
    #1
    1. Advertising

  2. On Feb 11, 8:33 am, JMnich <> wrote:
    > Hello!
    >
    > I try to concentrate on the basic facts as I suppose my problem to be.
    >
    > I created a c# website having its own sitemapprovider. The code for the
    > provider is located in a file in App_Code. The Provider makes calls to
    > methods of other classes (i call them module-classes) to set up the menu
    > structure. The code for each of the module-classes is lying in a different
    > subdir of the root (!) folder - each in a different namespace. To get all
    > necessary information for the menu from the module-classes I defined a Class
    > representing one menu item and the methods of the module-classes return an
    > array of this MenuItemClass depending on the users permissions for that
    > module.
    >
    > So now here's the problem: If I generate the project (which i can) and
    > publish it to a web server, everything works fine. If I try to debug the
    > project locally (what I really would like to do!) I get the following error:
    >
    > CS0029: Eine implizite Konvertierung vom Typ
    > "posy.web.controls.PosyMenuItem[]
    > [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    > Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DL L]"
    > in "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    > Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" ist nicht
    > möglich.
    >
    > I try to translate: An implicit Conversion from type
    > "posy.web.controls.PosyMenuItem[]
    > [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    > Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DL L]"
    > to "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    > Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" is not
    > possible.
    >
    > The line affected is:
    >
    > posy.web.controls.PosyMenuItem[] tmpArray = tmpInit.GetPosyMenuItems();
    >
    > and tmpInit is defined as
    >
    > posy.web.modules.communication.Init tmpInit = new
    > posy.web.modules.communication.Init();
    >
    > and in the Class-Definition for the class
    > posy.web.modules.communication.Init the method is defined as
    >
    > public posy.web.controls.PosyMenuItem[] GetPosyMenuItems()
    >
    > Please help! I have no idea, what's going wrong here...
    >
    > Thanx,
    >  Juergen.


    Try to make cast to (PosyMenuItem[]) and check what value returns
    tmpInit.GetPosyMenuItems(); when you debug it. Read more about error
    at http://msdn.microsoft.com/en-us/library/xzhh5fx5(VS.71).aspx

    Hope this helps
     
    Alexey Smirnov, Feb 12, 2009
    #2
    1. Advertising

  3. JMnich

    JMnich Guest

    Thank you for your answer... but that was not the problem.

    Playing around a little bit I finally found out, that without any changes to
    my files (!) everything works fine, if I move the SitemapProvider-Class and
    my MenuItem-Class from the App_Code-Directory to any other subdirectory.

    It seems, I do not understand the exact role of the App_Code directory. Can
    you tell me?

    Thank you for an answer,
    Juergen.


    "Alexey Smirnov" wrote:

    > On Feb 11, 8:33 am, JMnich <> wrote:
    > > Hello!
    > >
    > > I try to concentrate on the basic facts as I suppose my problem to be.
    > >
    > > I created a c# website having its own sitemapprovider. The code for the
    > > provider is located in a file in App_Code. The Provider makes calls to
    > > methods of other classes (i call them module-classes) to set up the menu
    > > structure. The code for each of the module-classes is lying in a different
    > > subdir of the root (!) folder - each in a different namespace. To get all
    > > necessary information for the menu from the module-classes I defined a Class
    > > representing one menu item and the methods of the module-classes return an
    > > array of this MenuItemClass depending on the users permissions for that
    > > module.
    > >
    > > So now here's the problem: If I generate the project (which i can) and
    > > publish it to a web server, everything works fine. If I try to debug the
    > > project locally (what I really would like to do!) I get the following error:
    > >
    > > CS0029: Eine implizite Konvertierung vom Typ
    > > "posy.web.controls.PosyMenuItem[]
    > > [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    > > Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DL L]"
    > > in "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    > > Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" ist nicht
    > > möglich.
    > >
    > > I try to translate: An implicit Conversion from type
    > > "posy.web.controls.PosyMenuItem[]
    > > [c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    > > Files\root\7c621665\7c8f6fd3\assembly\dl3\f9dbe31f\92d78025_685ac901\web.DL L]"
    > > to "posy.web.controls.PosyMenuItem[] [c:\Dokumente und
    > > Einstellungen\mnich\Desktop\posy\web\App_Code\PosyMenuItem.cs(15)]" is not
    > > possible.
    > >
    > > The line affected is:
    > >
    > > posy.web.controls.PosyMenuItem[] tmpArray = tmpInit.GetPosyMenuItems();
    > >
    > > and tmpInit is defined as
    > >
    > > posy.web.modules.communication.Init tmpInit = new
    > > posy.web.modules.communication.Init();
    > >
    > > and in the Class-Definition for the class
    > > posy.web.modules.communication.Init the method is defined as
    > >
    > > public posy.web.controls.PosyMenuItem[] GetPosyMenuItems()
    > >
    > > Please help! I have no idea, what's going wrong here...
    > >
    > > Thanx,
    > > Juergen.

    >
    > Try to make cast to (PosyMenuItem[]) and check what value returns
    > tmpInit.GetPosyMenuItems(); when you debug it. Read more about error
    > at http://msdn.microsoft.com/en-us/library/xzhh5fx5(VS.71).aspx
    >
    > Hope this helps
    >
     
    JMnich, Feb 16, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ^CrazyCoder^
    Replies:
    3
    Views:
    7,315
    Terrence Benade
    Sep 15, 2003
  2. Yan
    Replies:
    0
    Views:
    1,162
  3. Claude seraphin
    Replies:
    12
    Views:
    2,516
    samundersingh1983
    Feb 15, 2014
  4. Ken Stealth
    Replies:
    2
    Views:
    4,352
    =?Utf-8?B?amRneChDb2xvbWJpYSk=?=
    Jan 31, 2004
  5. Ram
    Replies:
    0
    Views:
    2,894
Loading...

Share This Page