Exception on client

Dec 14, 2010 at 12:32 AM

I can't get the source to run after compiling.

System.TypeLoadException was unhandled
Message=Could not load type 'RDPAddins.Common.Starter' from assembly 'RDPAddins.Common, Version=, Culture=neutral, PublicKeyToken=35a457c35bdf8fd8'.
at RDPAddins.Program.Main(String[] args)
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile)
at RDPAddins.Core.EntryPoint.<>c__DisplayClass4.<VirtualChannelEntry>b__1() in D:\dotnet\Samples\RDPAddins.Core\EntryPoint.cs:line 29
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

[ExportDll("VirtualChannelEntry", CallingConvention.StdCall)]
public static bool VirtualChannelEntry(IntPtr entry)
ManualResetEvent mrEvent = new ManualResetEvent(false);
AppDomain app = null;
var thread = new Thread(() =>

var assemblyname = "RDPAddins.exe";
var assemblypath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var assemblyfullpath = Path.Combine(assemblypath, assemblyname);
var configfile = assemblyfullpath + ".config";
app = AppDomain.CreateDomain("RDPAddins", new System.Security.Policy.Evidence(), new AppDomainSetup() { ApplicationBase = assemblypath, ApplicationName = assemblyname, ConfigurationFile = configfile });
app.SetData("entry", entry);
app.SetData("event", mrEvent);
/* this is where the exception occurs */


Any ideas ?

Dec 14, 2010 at 9:14 AM
Edited Dec 14, 2010 at 9:16 AM

> any ideas?

yes ... 

maybe another version of RDPAddins.Common is in GAC

try gacutil /l RDPAddins.Common

if there is any entry(of RDPAddins.Commeon) in GAC

1. try uninstall binary version

2. run gacutil /u RDPAddins.Common


new version no longer need to be installed in GAC nor strong name.


Dec 14, 2010 at 12:16 PM

Yes it was in the GAC. Now it works. I don't know why I didn't think of that! Thank you very much for your help.

Happy Holidays