File not found - security

I have a addon component that we have used many times before. However, on a particular site, I have had problems installing it. The addon component makes use of a .net dll to display some screen. Whenever I navigate to a screen generated by the dll, I get an error saying 'File not found', 'An error has occurred in a CRM .net customisation. Please contact your vendor to resolve'.

I have turn on maximum .net security and the following is what I got:

Class: CRMWrapper - Method: ExecWebPageNew - Error: Could not load file or assembly ', Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. PolicyException thrown. (Exception from HRESULT: 0x80131416)
Oct 11 2013 13:42:19.553 5744 7660 5 StackTrace:
Error: More than one exclusive group is not allowed.
at System.Security.Policy.PolicyLevel.GenericResolve(Evidence evidence, Boolean& allConst)
at System.Security.Policy.PolicyLevel.Resolve(Evidence evidence, Int32 count, Char[] serializedEvidence)
at System.Security.PolicyManager.CodeGroupResolve(Evidence evidence, Boolean systemPolicy)
at System.Security.PolicyManager.ResolveHelper(Evidence evidence)
at System.Security.HostSecurityManager.ResolvePolicy(Evidence evidence)
at System.Security.PolicyManager.Resolve(Evidence evidence)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)

I have given everyone access to the CustomDotNet folder, but I think this has something to do with .net framework and caspol.

I have tried the following, but it didn't help:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file://E:\Company Data\Sage200\CRM\CRM\CustomDotNet\*" FullTrust -exclusive on
PAUSE

Has anyone got any suggestions. This is CRM version 7.1.g

Thanks

Andrew

  • 0

    Hi Andrew,

    There could be 2 possible reasons for this.

    1. DLL path is not correct in system parameters. To check and resolve this error, check below blog.

    http://www.greytrix.com/blogs/sagecrm/2011/04/25/sage-crm-net-api-check-points/

    2. If there are multiple versions of CRM installed on the server then there could be an issue with Sage CRM Wrapper DLL as in assembly we find wrapper only for the latest installed version. To resolve this error, you can follow below blog.

    http://www.greytrix.com/blogs/sagecrm/2013/08/20/wrapper-error-in-sage-crm/

    If you follow any of the changes above, you have to perform IISRESET.

    Hope this helps!

    Regards,

    Dinesh

  • 0

    Hi Dinesh

    Thanks for the reply. Unfortunately I have tried both links (checking the folder location and registering the dlls) and performing IISRESET, but I still get the error. Any more suggestions?

    Thanks

    Andrew

  • 0

    Hi All

    I managed to get this working in the end. I had multiple duplicate caspol entries. So I did the following:

    Create a batch file and dump this in there:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Caspol -a -listgroups >c:\out.txt

    PAUSE

    This will give you a list of groups, and you can see if there are any duplicates. Then create another batch file and dump something like the following in there:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -rg 1.7

    PAUSE

    This will remove a group, in this case group number 1.7

    After running the first batch file again, I was left with only one of my entries:

    1.6. Url - file://E:\Company Data\Sage200\CRM\CRM\CustomDotNet\*: FullTrust (Exclusive)

    This was added previously using something like the following:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file://E:\Company Data\Sage200\CRM\CRM\CustomDotNet\*" FullTrust -exclusive on

    PAUSE

    Then do an IISRESET.

    And then everything worked.

    Thanks

    Andrew

    (caution: only remove groups that mean something to you)