• Register
0 votes

Problem :

 I am facing below error

“System.security.securityexception: that assembly does not allow partially trusted callers.

 Is it possible to make my Library to allow partially trusted callers?

8 4 2
2,300 points

1 Answer

0 votes

Solution :


I came across your problem on this forum. I have faced this issue before and there are multiple ways to fix this issue.

1.Try to change the framework if it is 3.5. I changed mine to 4 or above my issue got fixed.

2.I Copied the folder to the drive local to my guest OS and it fixed the issue for me.

3.You can add below lines to your web.config

<trust level="Full" />
It fixed the issue

4.You can go to go to your dll properties and then just press the Unblock button:It will fix the issue.

5. If you are running the command line app and experiencing the issue then: right click on the project >go to settings > go to security > and uncheck the "Enable ClickOnce Security Settings option it will solve the issue.

6.You can give your library that you are trying to call the very strong name.

Then just add assembly:AllowPartiallyTrustedCallers to your library that you want to call.

After that create the code group to set the permissions to your library.

5 2 1
4,980 points

Related questions

0 votes
1 answer 43 views
Problem : I am trying to run some of the unit tests in the C# Windows Forms application (Visual Studio 2005), however I am facing the below error : System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=, Culture=neutral, PublicKeyToken= ... version Any pointers on how can I figure out what is trying to reference the old version of my DLL file?
asked Dec 23, 2019 alecxe 7.5k points
0 votes
1 answer 15 views
Problem: I have tried to upload my website to a server for the very first time. My website was working fine at my local host so I tried to upload everything from my localhost to the server and then I also changed the connection string. But still I ... dependencies. The system cannot find the file specified. at RouteDebug.PreApplicationStart.Start() What should I do to fix the above server error?
asked Aug 26 Raphael Pacheco 4.9k points
0 votes
1 answer 25 views
Problem: I have recently created the Excel Add-In which is work as expected if I run it directly from the Visual Studio but now I am trying to use my Add-In on some another computer. To do this exercise I copied my [AddIn].vsto file from the project: bin/Release/ ... () I have already tried to clear cache of a oneClick but still it is not working for me. Also I have tried a CCleaner Tool.
asked Jul 25 Raphael Pacheco 4.9k points
1 vote
1 answer 57 views
Problem : I am very new to Azure. Recently I have started experiencing the error if I try to connect my database which is currently in the VM Role it is the SQL VM Role from the Azure Website. I am experiencing following issue: SqlException (0x80131904): A connection ... : 0 - The certificate chain was issued by an authority that is not trusted.)] Can someone kindly help me in fixing above error.
asked Apr 2 morrisBson 3.2k points
0 votes
1 answer 297 views
Problem : I am trying to create the test app using unity but facing following issue: readpixels was called to read pixels from system frame buffer, while not inside drawing frame.
asked Nov 14, 2019 peterlaw 6.9k points