Referencing assembly from GAC using @assembly fails

B

Brent

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
found."

Why is this occurring and how can this be fixed?
 
B

Brent

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.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top