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

J

JMnich

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.
 
G

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.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
 
J

JMnich

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.


Anon User said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top