Question

That assembly does not allow partially trusted callers

Posted 8 years ago by Avatar Oli
I'm using version 3.1.17.0

I'm having a few problems using the component in medium trust mode. I've chased everything around for a few days and I'm getting quite dizzy so I was wondering if you could help me out.

I'm accessing the main assembly from another assembly of mine that is strongly named. When setting our debug platform to run on medium trust (to match the production server) it is breaking at any point that we try and use your assembly, giving the following error:
System.Security.SecurityException: That assembly does not allow partially trusted callers.

We ran into this problem ourselves when out plain aspx files tried to use our assemblies and remedied this by adding the AllowPartiallyTrustedCallers tag to the assembly info.

I'm basically asking if you can do the same with your binaries or give me a workaround to allow us to continue using your fabulous product.


Cheers in advance,

Oli

Comments (9)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Question, what happens if you place our and your assembly in the GAC? I think that places full trust into the assemblies.

Actipro Software Support
Posted 8 years ago by Oli
I'm on shared hosting which is the killer here...

I'm sure placing it in the GAC would fix it but I'd have to get a plane ticket, fly out to Florida, stalk and beat the admin into submission and that's before getting the configs working =)

I'm not sure if there's any security problem from adding the AllowPartiallyTrustedCallers tag in the assembly info from your point of view but it certainly would make my (and other developers confined to medium trust locations') lives a lot easier.

If it is impossible from your side I'll just have to get the plane ticket =)

Thanks for the quick response though,
Oli
Posted 8 years ago by Oli
Oh and I think the problem is to do with your assembly not trusting my partially trusted assemblied because they're running in medium trust.

I cant see any way around this other than getting the host to trust my assemblies (really not going to happen because its shared hosting) or you allow partially trusted assemblies in your assemblyinfo
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
We've added the attribute to Shared/WinUICore/CodeHighlighter assemblies for the next release. Since the Shared and WinUICore libraries are being updated, we'll have to redeploy all our products with this change. So we might still need another week or two to make changes to other products before getting this out.

Actipro Software Support
Posted 8 years ago by Zachary Way
has this been added to the recent assemblies? I've downloaded the lastest version, and I'm also getting the application trust errors on my shared host...is there something else I need to do that isn't included in the documentation?
Posted 8 years ago by Oli
I'm still using the beta (I think) version from when we worked this over when I was having the issue...

You can check for yourself if the current version has the tags assigned by using .NET Reflector and checking each assembly for the tag.

You can get that here:
htttp://www.aisto.com/roeder/dotnet
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Yes, that was added a long time back for Oli. I just verified that both the Shared and CodeHighlighter assemblies do have AllowPartiallyTrustedCallers attributes set.

Actipro Software Support
Posted 8 years ago by Oli
I think I actually got it added to the GAC in the end. And it was a release version.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
We found the issue. It appears to be an undocumented change when ASP.NET 2.0 was released.

All you have to do is add a requirePermission="false" attribute in the web.config file for the "codeHighlighter" section tag.

So the modified tag should appear like this:
<configSections>
    <section name="codeHighlighter" requirePermission="false"
     type="ActiproSoftware.CodeHighlighter.CodeHighlighterConfigurationSectionHandler, ActiproSoftware.CodeHighlighter.Net20" />
</configSections>

Actipro Software Support
Information The latest build of this product (v4.0.0059) was released 4 years ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.