I have upgraded my Fluent NHibenate to 1.2 because I have upgraded NHibenate to version 3.0. This was in turn because I use ANTLR in my project and had compatibility issues between ANTLR versions. I now get this error creating mappings as part of the Fluently.Configure() call which I did not previously get with version 1.0.X.X using the same assemblies. I am developing in C# .NET 3.5 in VS2008.
Error is "The invoked member is not supported in a dynamic assembly."
public static ISessionFactory GetFactory()
{
if (_factory == null)
{
Assembly assembly = Assembly.Load("BigFoot.Infrastructure");
IApplicationContext springContainer = ContextRegistry.GetContext();
IDbProvider provider = (IDbProvider)springContainer.GetObject("DbProvider");
string connection = provider.ConnectionString;
if (connection.Length > 0)
{
_factory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(connection))
.Mappings(m =>
{
m.FluentMappings.AddFromAssembly(assembly);
m.HbmMappings.AddFromAssembly(assembly);
})
.BuildSessionFactory();
}
}
return _factory;
}
For those who will face the problem again. This exception is a normal behaviour, because it is not an unhandled one. The only reason you see it is that visual studio configured so you see all the exceptions (handled and unhandled) and 'debug just my code' is disabled. So you can just ignore the exception and press continue when it is caught or configure visual studio so that it doesn't show such exceptions to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With