Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Referencing assembly from GAC using @assembly fails

Thread Tools

Referencing assembly from GAC using @assembly fails

Posts: n/a
I have strong named an assembly and installed it into the GAC. I have
copied the same assembly to a local folder and made reference to it
and set 'Copy Local' to false in the VS IDE, so that my code compiles.

Then I put the @assembly directive in the html code like this:
<%@ Assembly Name="MPCommon"%>

When I try to run the page, I get a parser error saying:

"File or assembly name MPCommon, or one of its dependencies, was not

Why is this occurring and how can this be fixed?
Reply With Quote
Posts: n/a
I finally figured this out.

I took the '@ assembly' reference out from the .aspx page and put it
into the web.config page. However, it threw an error and so I put it
into machine.config and it worked. However, when I would change the
assembly it didn't download the right one to the calling application.
Later, I found out that the aspnet_wp.exe (worker process) would have
to be killed and then reloaded to serve up the right one from the GAC.
On a production server I simply cannot afford to do this as session
state would be lost and I'd get fired. So, I tinkered again with
web.config and discovered that I didn't place the '<add assembly...'
reference in the right spot on the page, under '<compilation...>'. Now
it works fine and downloads changes.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing a assembly from the GAC =?Utf-8?B?RGFsZQ==?= ASP .Net 8 04-26-2006 01:19 AM
Web Assembly in GAC, Page Inherits Strongly Named Assembly? ASP .Net 0 12-03-2005 01:31 PM
referencing assembly in GAC Rod Snyder ASP .Net 3 12-29-2004 03:03 PM
Referencing Assembly Question Without GAC? =?Utf-8?B?TWlrZQ==?= ASP .Net 12 12-02-2004 04:59 AM
Using Custom Assembly Installed in GAC =?Utf-8?B?Q2hyaXMgRmluaw==?= ASP .Net 5 11-01-2004 09:05 PM