Reference required to assembly error

J

John

Hi there,

Can anyone decypher what this error is telling me? This is something that
was working perfectly happily after making some changes recommended by Bruce
Barker (see:
http://groups.google.co.uk/group/mi...ss+method+in+master's+master#5fab6e75f47ff1c4)

The only thing I've changed is that I deleted a couple of content page files
that weren't being used.

Anyway, if you're able to point me in the right direction for tracking down
the problem I'd be very grateful.

Best regards

John

PS the error gets thrown in the Page Load event of the content page, which
has a master, which itself has a master.

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30652: Reference required to assembly
'App_Web_i0omzneq, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
containing the type 'ASP.mainmaster_master'. Add one to your project.

Source Error:


Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Line 6: CType(Master.Master, ISetMenus).SetMenu("Products")
 
S

Steven Cheng[MSFT]

Hi John,

From your description, you're getting some compilation error after applying
some changes(together with the one in another thread) to your application
,correct?

As you mentioned that you have removed some content page files, is there
anything in the content pages that has been referenced by the master pages
(or other pages left in the application)? For example, do you have any
variable or members in master or other class that reference some certain
content page that has been removed?

In addition, after you changed the application, have you recompiled the
application and deploy it again or is the problem occuring in development
environmente even when you use Visual Studio to run it?

BTW, if you still have the original version(unchanged one) of your
application, I suggest you run it again, and check the following
assemby(mentioned in error message):

App_Web_i0omzneq.dll

you can try locating it from ASP.NET temporary folder and use reflector to
see what classes does it include. This may also help some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
J

John

Hello Steven,

Thanks for your reply. I'll answer your questions in turn:

Description - It all worked fine using Bruce's (other thread) suggestion.
The problem appeared to occur after deleting the content files.

Referencing content that's been removed - No, nothing as far as I can tell.

Recompiled - Yes, but no change.

Deploy - Unfortunately I haven't got anywhere that I can easily deploy if to
at the moment so this is just in the dev environment (VS2008 Pro)

Original version - Alas I didn't keep a copy (deleting a few content files
didn't feel that significant)

By the way, the compiler error message changes each time you run the page,
or at least the 'App_Web_######, part does:

Compiler Error Message: BC30652: Reference required to assembly
'App_Web__bcsdg1f, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
containing the type 'ASP.mainmaster_master'. Add one to your project.

My assumption was that it's needing a reference to the Master.Master part,
but I don't quite understand as it appeared to be quite happy with Bruce's
Interface type conversion before. So why does it think it needs one now I
wonder?

Thanks

John
 
J

John

Hello Steven,

Well after a long process of working through your advice, including using
reflector, I've trailed it in other content pages and no error appears, so
it looks like the Test conent page did have some kind of missing dependancy
(although I still can't see it for looking).

Anyway, thanks again for your help.

Best regards

John
 
S

Steven Cheng[MSFT]

Hi John,

Thanks for your followup.

Glad that you've got progress. So you're using isolation method to detect
the problem page. I agree that's a good method though sometimes may cause
more time. Anyway, if you got further results or need any help, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "John" <[email protected]>
Subject: Re: Reference required to assembly error
Date: Wed, 30 Jan 2008 00:02:11 -0000
 
J

John

Hi Steven,

Well I think I've finally tracked down the real problem. It appears to be a
problem of Master confusion. The code (in code behind Page Load event),
which calls a method in the page's master's master (MainMaster) below works
fine:

CType(Master.Master, ISetMenus).SetMenu("Products")


I then added a page directive in the aspx page to get a reference to the
page's direct master (LeftNav):

<%@ MasterType VirtualPath="~/LeftNav.master" %>


....and added another call to a method in LeftNav master:

CType(Master.Master, ISetMenus).SetMenu("Products")

Master.SetLeftNavTree("Products", "Products")


Adding this second line produces the compilation error, but either way will
work by itself (ie if you took out the CType line).

Any clues as to why it does this and how I can reference both the direct
master and the master's master at the same time?

Thanks

John
 
S

Steven Cheng[MSFT]

Thanks for your reply John,

Glad to hear your progress. As for the isolated error behavior( two Master
page reference call can not coexists), I also feel abit strange. I suggest
you try remnove the <%@ MasterType VirtualPath="~/LeftNav.master" %>
directive in your content page and call both of the Masters through
interface(also define a interface for your direct Master) to see whether it
works.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: "John" <[email protected]>
Subject: Re: Reference required to assembly error
Date: Wed, 30 Jan 2008 06:41:22 -0000
Hi Steven,

Well I think I've finally tracked down the real problem. It appears to be
a
 
J

John

Hi Steven,

Yes, that's a good idea. I'll have a go at the interface route for both.

Thanks agian for all your help.

Best regards

John
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top