Could not load type containing assembly is not loaded as fully trusted
-
Friday, May 11, 2012 3:42 AM
Folks,
I am calling a code that references Interop.CERTCLIENTLib.dll and Interop.CERTENROLLLib.dll. I have two issues:
1) When I deploy my project, these two dlls from the bin folder are not copied over to the server;
2) I cannot sign these two dlls in order to add them to GAC;
How can I stop receiving the error "Could not load type containing assembly is not loaded as fully trusted"?
Thanks a lot.
All Replies
-
Friday, May 11, 2012 6:15 AM
Hi,
You are referring Interop assembly, xcopy of interop dlls will not work as it required registration. you can use regasm to register on installation.
When you are seeing the error?
GAC is fully trusted area of assembly since it resides in local. to register with GAC assembly should be strongly named.
please provide more details to be able to help you...
also look into this topic : registration-free activation as shown from (if it suites you)
http://msdn.microsoft.com/en-us/library/ms973913.aspx
If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
-
Monday, May 14, 2012 12:11 AM
I publish my code to my server (VM w/Windows Server 2008) and I get this error... I cannot setup my local server as a full trust because this would never be accepted by any admin out there.
I do know it needs to be strongly named but this DLL is not mine and because of that I do not have the code and cannot change it.
I am running out of ideas to get this code working.
-
Monday, May 14, 2012 8:20 AMModerator
I think you can change the reference Embed Interop Type to False, and then set the Copy Local to true.
Then you can use this way to sign the two assemblies with strong name: http://msdn.microsoft.com/en-us/library/xc31ft41.aspx
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
- Edited by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Wednesday, May 16, 2012 8:06 AM
- Marked As Answer by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Wednesday, May 16, 2012 8:08 AM
- Unmarked As Answer by Gabriel Souza Sunday, May 20, 2012 5:55 PM
-
Sunday, May 20, 2012 5:56 PMThanks Mike, I will test your approach... Will get back to you asap...
-
Wednesday, May 23, 2012 11:59 AMModeratorI am writing to check the status of the issue on your side.
What about this problem now?Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
-
Friday, May 25, 2012 2:50 AM
Hi Mike, plz give me a couple of days, I am out of town working with no access to this stuff. I will reply back on Sunday...
-
Friday, May 25, 2012 6:38 AMModerator
Ok, I will try to help you once I get the updates from you.
Have a nice weekend!
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
-
Sunday, May 27, 2012 5:04 PMMike,
While trying to sign the DLL using the Assembly Linker tool, I keep getting the message "No valid input files were specified".
After a little research, I read this is about the module name on the following line:
=> al /out:<assembly name> <module name> /keyfile:<file name>
Researching a bit more, I read we cannot sign an existing unsigned assembly with Al.exe tool. I read this at http://www.devnewsgroups.net/dotnetframework/t30397-sign-assembly-with-strong-name-using-al-command.aspx. Not sure if this is true...
I do not have access to the DLL code as I said on my second post.
Any idea?
Thanks again.
- Edited by Gabriel Souza Sunday, May 27, 2012 7:09 PM
-
Monday, May 28, 2012 6:40 AMModerator
Yes, we cannot just use the al tool to sign a ready-made assembly.
So, we can use the ildasm to dis-assembly the assembly, and then use our key to strong name it through the al tool.
http://ianpicknell.blogspot.com/2009/12/adding-strong-name-to-third-party.html
Best wishes,
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Wednesday, May 30, 2012 9:37 AM
-
Saturday, June 02, 2012 2:33 PMAmazing Mike, it works like a charm... Thanks so much for taking time to help.
- Edited by Gabriel Souza Saturday, June 02, 2012 2:40 PM
-
Monday, June 04, 2012 3:33 AMModerator

