CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 6/8/2007 5:22:17 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 9 Views: 31 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
10 Items, 1 Pages 1 |< << Go >> >|
rajkumarsharma
Asp.Net User
Partially Trusted Callers6/8/2007 5:22:17 AM

0/0

In my Application ,When I am hosted my application , that gives an error....

"
Exception: System.Security.SecurityException:That

assembly does not allow partially trusted callers.

Description: Application attemped to perform an

operation not allowed by the security policy.

To grant this application the required permission,

please contact your system administrator or change the

application trust level in the configuration file   "

 

I called the Hosting Company and they confirm that

the application runs on a Full Trust but their system

supports application with Medium Trust.

 

Ok , So I make my changes in Web.Config as

 <trust level="Medium" originUrl=""/>

 

I am also making a reference to an assembly from where this error is coming and added one line in it's assembly info class as

 <Assembly: AllowPartiallyTrustedCallers()>  

 

But still the error is same .

To test the application I set  

 <trust level="Medium" originUrl=""/>    in my machine level config file.

 

What else should I do.

This is very urgent.

Any kind of help is appreciated.
 

 

 


 


rajkumar sharma
Kadjiokou
Asp.Net User
Re: Partially Trusted Callers6/8/2007 5:45:22 AM

0/0

This subject is covered in the book:

Professional ASP.NET 2.0 Security, Membership, and Role Management
by Stefan Schackow 

HTH

/Kadji

rajkumarsharma
Asp.Net User
Re: Partially Trusted Callers6/8/2007 6:43:12 AM

0/0

Two more thing to add..

First ,I am using asp.net 2.0 and secondly, my assembly is referencing  another assembly ( named:  MySql.Data.dll ) which is a third party assembly.

 
Second , What is the link  of strong name with this error.

Should my assembly be strong named. 



rajkumar sharma
donkiely
Asp.Net User
Re: Partially Trusted Callers6/8/2007 3:25:21 PM

0/0

Something isn't making sense here. You were originally running it as a full trust application and got the error? Then you talked to the hosting company, changed the trust level to medium, and still got the error. Is this all correct?

If so, it suggests that there is something else going on. Is the assembly being called directly from the code in a page, or indirectly through another assembly?

Anyway, on the surface it sounds like you've done the right things. We just have to figure out what is going on. 

Don


Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
rajkumarsharma
Asp.Net User
Re: Partially Trusted Callers6/9/2007 1:31:41 AM

0/0

 No donkiely,

Let me explain again.

I have my application running on full trust. OK

After that I went to hosting company where they provide only medium trust.

So I have to  make my site to run in medium trust by changing in web.config file.

But there That error came. 


rajkumar sharma
donkiely
Asp.Net User
Re: Partially Trusted Callers6/9/2007 4:12:43 AM

0/0

Okay, I think I finally understand.

But to make sure: The application is running under medium trust on the hosting server.  Your Web app calls an assembly, which in turn calls MySql.Data.dll. Do I have this right?

If I have this right, the problem is arising because MySql.Data.dll doesn't have the AllowPartiallyTrustedCallersAttribute (APTCA) set. This is what is happening, in a nutshell: Your partially trusted Web app is calling your custom assembly, which has APTCA set. That custom assembly is also running under partial trust, and is trying to call MySql.Data. But because MySql.Data doesn't have APTCA, you get the exception.

Make sense?

One solution is to create another assembly that wraps MySql.Data. IOW, its only purpose is to pass calls to MySql.Data. That assembly has to run with full trust, and must include APTCA. Then, because it runs with full trust, it can call MySql.Data.

Whether or not you can make this work depends on whether you can get your hosting company to let you run your custom assembly with full trust. Or you could try to convince the MySql people to decorate their assembly with APTCA. That may or may not be possible.

Don 


Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
rajkumarsharma
Asp.Net User
Re: Partially Trusted Callers6/10/2007 11:16:08 AM

0/0

 Okay Mr. donkiely,

that means that hosting company should should run that custom assembly(sql.data.dll) with full trust. (What if they don't agree ).

I think I should explain my problem in detail.

Okay here I go,

I have My assembly called Query.dll( Which have queries written in it) which in turn calls another assembly called QueryBase.dll (Which defines which database has to call and set up the connection and connection string ,  becoz my application can use oracle or SQL or Acess or MySql ) which in turn calls this third party assembly called Sql.Data.dll.

One Stupid question(plz don't mind ) : - Should I have to make my these two assemblies strong to run on medium trust. ( about third assembly i don't know).

Becoz my assemblies are not strong.

I have tried APTCA  in my these two assemblies ( Query.dll & QueryBase.dll) but it didn't work ( may be my assemblies are  not strong ).

 

Bottom line is ....

My application works perfectly under Full trust.

But My hosting company does not allow full trust ( only supports Medium trust.)

When I make my aplpication to run on medium trust I have Error. 

By for now....

 

Now plz tell me what should  do.

 

 


rajkumar sharma
donkiely
Asp.Net User
Re: Partially Trusted Callers6/10/2007 7:32:12 PM

0/0

Hmm. Off the top of my head I don't know if you have any options. I need to play around with the MySQL connector to see what options there may be, but I'm not optimistic. Let me do that and I'll let you know what I find.

In the meantime, if anyone else knows or sees what I'm missing, chime in!

Don 


Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
rajkumarsharma
Asp.Net User
Re: Partially Trusted Callers6/11/2007 12:51:51 AM

0/0

Should my assemblies be strong named , to run in medium trust, in my case for my two assemblies. 


rajkumar sharma
donkiely
Asp.Net User
Re: Partially Trusted Callers6/11/2007 8:44:35 PM

0/0

rajkumarsharma:

Should my assemblies be strong named , to run in medium trust, in my case for my two assemblies. 

 

That is not a requirement of running with non-Full trust. But a strong name can be necessary to match the assembly with a membership condition of a code group that assigns it a particular permission set. It's one of many options.

But if you're asking if this is the problem, no it isn't.

Don 


Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
10 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Windows Forms Programming in C# Authors: Chris Sells, Pages: 681, Published: 2004
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Writing Secure Code: practical strategies and proven techniques for building secure applications in a networked world Authors: Michael Howard, David LeBlanc, Pages: 768, Published: 2003
The .Net Developer's Guide to Directory Services Programming Authors: Joe Kaplan, Ryan Dunn, Pages: 479, Published: 2006
.NET Development Security Solutions Authors: John Paul Mueller, Mueller, Pages: 472, Published: 2003
Pro SQL Server 2005 Assemblies Authors: Robin Dewson, Julian Skinner, Pages: 268, Published: 2005
Visual C# 2005 Recipes: A Problem-Solution Approach Authors: Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 565, Published: 2006
Visual Basic 2005 Recipes: A Problem-Solution Approach Authors: Todd Herman, Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 664, Published: 2007
Programming .NET Components: Design and Build .NET Applications Using Component-Oriented Programming Authors: Juval Lowy, Pages: 624, Published: 2005

Web:
.NET Security Blog : Allowing Partially Trusted Callers The AllowPartiallyTrustedCallersAttribute (affectionately referred to as APTCA from here on out), is one of the aspects of the security system that most ...
Allowing Partially Trusted Callers Sharing code libraries is a common scenario with common language runtime (CLR) integration, where an assembly containing a user-defined type, ...
Deciding When To Enable Partially Trusted Callers The implicit LinkDemand for full trust that shared libraries perform by default helps provide your code a high level of protection by not allowing untrusted ...
MSDN Visual C# General "That assembly does not allow partially ... "That assembly does not allow partially trusted callers." Be aware that if your code is .net framework 1.1, but the user's machine has . ...
Assembly does not allow partially trusted callers? PayPal ... SecurityException: That assembly does not allow partially trusted callers. Anyone have a clue what this is about? Im not the most .net savvy ...
That assembly does not allow partially trusted callers. Q10334 - PRB: That assembly does not allow partially trusted callers. ... Without APTCA, strong named assemblies issue a demand for full trust, ...
[ASP.Net] Security Exception (partially trust callers) in Medium ... Their reaction was that I had to use a component that doesn't require partially trusted callers as they won't edit the trust level. ...
SecurityException: That assembly does not allow partially trusted ... Apr 7, 2006 ... Do make sure your assembly is indeed safe to be called by partially trusted callers before you apply that attribute to your own code (like ...
"does not allow partially trusted callers" or "file not found ... Now I don't get the previous error (..partially trusted callers. ... I want to allow partially trusted callers to the ChartFX assemblies, ...
Allow Partially Trusted Callers - What does APTC stand for ... What does APTC stand for? Definition of Allow Partially Trusted Callers in the list of acronyms and abbreviations provided by the Free Online Dictionary and ...




Search This Site:










role problem - not being assigned on tab save - urgent

how to force a clean installation

how to remove the dnnlogo?

desktop application for vs 2005

sha-1 and retreiving password

dnn 3.0,5: table and sproc naming

programmatically setting selectedindex of dropdown list by its text value

open new window in dnn 3.0

problem with iframe

looking for dnn2 jobs module

installed framework before iis - how to get iis to serve .aspx pages

can we put mast page into another mast page

displaying checkboxes programmatically

potentially dangerous request.form value...

passing variables - best practices

correct way to build url w/querystrings

development time increase

urgent: sessions are not working in iis but cookies are working...

cookie based auth. mechanism started to go wrong!

when stop on a break point, how to check current stack? thanks

profile properties

output parameter

visual web developer 2005

relative path problems on development server because of ports

treeview formatting

rewrite in .net

dnn 3.1 skins

tree view control

how to test appcode classes from nunit..

dropdownlist (datatextfield with two fields)

 
All Times Are GMT