chanxianzhong / mybatisnet

Automatically exported from code.google.com/p/mybatisnet
0 stars 0 forks source link

Loading dynamic assemblies fails with 'System.NotSupportedException' #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the MyBatis.NET are you using?
I use iBatis.NET 1.6.2

Problem:
I have embedded providers tag in my SqlMap.config.
<providers embedded="ProjectName.providers.config"/>
I can't be replaced with following tag because of external requirements:
<providers embedded="providers.config, ProjectName"/>

With that specified iBatis should look for providers.config file by iterating 
through all assemblies. (Utilities\Resources.cs:438)
That worked on machines with .NET prior to 4.0

After moving to .NET framework >4 when iBatis code loads providers, following 
exception is thrown: 'System.NotSupportedException'. GetAssemblies does not 
only return dynamic assemblies.
This issue is related to CLR that runs our application.

This issue is also described here: 
http://bloggingabout.net/blogs/vagif/archive/2010/07/02/net-4-0-and-notsupported
exception-complaining-about-dynamic-assemblies.aspx

Expected output:
File providers.config is loaded successfully.

Original issue reported on code.google.com by rozanski...@gmail.com on 15 Mar 2013 at 6:52

GoogleCodeExporter commented 8 years ago
I wrote that I use iBatis.NET 1.6.2 but related code in myBatis.NET remains 
unchanged also.

Original comment by rozanski...@gmail.com on 15 Mar 2013 at 7:00