Referencing assembly from GAC using @assembly fails

Discussion in 'ASP .Net' started by Brent, Jan 14, 2004.

  1. Brent

    Brent Guest

    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?
    Brent, Jan 14, 2004
    #1
    1. Advertising

  2. Brent

    Brent Guest

    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.
    Brent, Jan 23, 2004
    #2
    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. =?Utf-8?B?Q2hyaXMgRmluaw==?=

    Using Custom Assembly Installed in GAC

    =?Utf-8?B?Q2hyaXMgRmluaw==?=, Nov 1, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    4,715
    Ken Cox [Microsoft MVP]
    Nov 1, 2004
  2. =?Utf-8?B?TWlrZQ==?=

    Referencing Assembly Question Without GAC?

    =?Utf-8?B?TWlrZQ==?=, Dec 1, 2004, in forum: ASP .Net
    Replies:
    12
    Views:
    759
    =?Utf-8?B?TWlrZQ==?=
    Dec 2, 2004
  3. Rod  Snyder

    referencing assembly in GAC

    Rod Snyder, Dec 27, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,818
    Ken Cox [Microsoft MVP]
    Dec 29, 2004
  4. Replies:
    0
    Views:
    663
  5. =?Utf-8?B?RGFsZQ==?=

    Referencing a assembly from the GAC

    =?Utf-8?B?RGFsZQ==?=, Apr 21, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    2,253
    Steven Cheng[MSFT]
    Apr 26, 2006
Loading...

Share This Page