Jump to content
Software FX Community

"does not allow partially trusted callers" or "file not found"


fkeller

Recommended Posts

Hi,


My context: WebPart development in WSS 3.0 (SharePoint)


Scenario 1: get the "Assembly does not allow partially trusted callers" error
I get the following error when adding the ChaftFX assemblies to the bin directory: "Assembly does not allow partially trusted callers".
I have registered as SafeControls all the assemblies with all namespaces in the web.config.
------------------------------------------------------------------
<SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms" TypeName="Chart" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.DataProviders" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Galleries" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal.Highlight" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms, Version=7.0.2845.31164, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal.Pss" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Base, Version=7.0.2845.31033, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Base, Version=7.0.2845.31033, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Adornments" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Base, Version=7.0.2845.31033, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Base, Version=7.0.2845.31033, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal.Pss" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Dhtml, Version=7.0.2845.31087, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Dhtml" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Adornments, Version=7.0.2845.31057, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Adornments" TypeName="*" Safe="True" />
  <SafeControl Assembly="ChartFX.WebForms.Adornments, Version=7.0.2845.31057, Culture=Neutral, PublicKeyToken=a1878e2052c08dce" Namespace="ChartFX.WebForms.Internal" TypeName="*" Safe="True" />
------------------------------------------------------------------
 
But no success...exception raised.


Scenario 2: "file not found" in SharePoint.
I tried then to add the assemblies to the GAC instead. Now I don't get the previous error (..partially trusted callers..) and the webpart does not throw any execption, but I get a "File not found" in SharePoint... SharePoint is looking in the bin dir for the assemblies.


 
Just to give a try I mixed both scenarios and it works...??!! Seems that SharePoint check the security with the assemblies in the GAC and then wants to load them only from the bin directory. But having the assemblies in both, GAC & bin, is not a solution.


How can I configure SharePoint to use either scenario 1 or scenario 2?
I want to allow partially trusted callers to the ChartFX assemblies, so I can have them in the bin directory. Can I do that?


Thank you for your support


Frederic Keller 

Link to comment
Share on other sites

Precisions regarding Scenario 2.

The Chart is correctly added to the WebPart Child Controls.
-------------------------------------
protected override void CreateChildControls()
{
  base.CreateChildControls();
  ChartFX.WebForms.Chart myChart = new ChartFX.WebForms.Chart();
  this.Controls.Add(myChart);
}
-------------------------------------

But to make the chart rendered in my SharePoint Page with the WebPart containing the chart I need to add the assemblies to the bin directory in addition to the GAC....??!!

Link to comment
Share on other sites

  • 2 weeks later...

Frederic,

 

The ChartFX dlls should not be added to the GAC. Instead, please place them in the bin directory of your Sharepoint website.

Attached to this post, you will find a PDF document providind step by step instruction on how to get ChartFX to run in Sharepoint. Please follow the steps and pay particular attention to steps 2 and 3 of the second part of the document ( Sharpeoint Configuration).

If you have any questions or continue to run into issues, please let us know. 

 

TomasT

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...