FileNotFoundException: "Could not load file or assembly" although assembly exists

BobTurbo picture BobTurbo · Jul 6, 2011 · Viewed 10.3k times · Source

I am trying to create a custom membership and role provider. The code for this seems to be fine, but when I try to go to the Security section of the Web Site Administration Tool, I get the following:

The invoked member is not supported in a dynamic assembly.

In reference to the first line of the first bit of NHibernate-related code that is called:

var cfg = new Configuration();

followed by:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'NHibernate.XmlSerializers, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.

Before that I get a few:

Culture name 'aspx' is not supported.

I have the providers in the App_Code folder and the NHibernate DLLs are copied to the Bin folder on execution of the application.

I am assuming it is to do with the providers not being able to find all of the relevant classes and dlls related to NHibernate and the Role class and so on.


For whatever reason, this problem went away.

Answer

David picture David · Mar 12, 2012

I had the same thing, turns out it wasn't really a problem. I had IDE set so that it will break on Exceptions

After reading this link below I realised.

http://www.mail-archive.com/[email protected]/msg06043.html

You can simply hit F5 and continue running. That's pretty much all I know