views:

299

answers:

2

i host my web site in shared hosting server, this server use the default Medium trust level

When i execute this

ConfigurationDataCollection configurationDatumCollection = new ConfigurationDataCollection().Where(ConfigurationData.Columns.Name, configurationSectionName).Load();

i get this error

That assembly does not allow partially trusted callers.

at SubSonic.ELib3DataProvider.GetReader(QueryCommand qry) at SubSonic.DataService.GetReader(QueryCommand cmd) at SubSonic.Query.ExecuteReader() at SubSonic.AbstractList`2.Load()

How i can solve this?

+1  A: 

SUbSonic 2.x works in medium trust just fine - provided you're not using the BuildProvider. The Enterprise Library, however, has problems: http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=8832

I think your configuration on Ent. Lib needs to be tweaked, or you can toss it altogether and probably fix your problem.

Rob Conery
+1  A: 

Thanks Rob

Before i has in web.config

<SubSonicService defaultProvider="ELib2DataProvider"> 
<providers> 
<add name="ELib2DataProvider" type="SubSonic.ELib2DataProvider, SubSonic" connectionStringName="CommerceTemplate"/> 
</providers> 
</SubSonicService>

and i change for this

<SubSonicService defaultProvider="SqlDataProvider"> 
<providers> 
<add name="SqlDataProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="CommerceTemplate"/> 
</providers> 
</SubSonicService>

And run in Medium trust level