This project is read-only.

Exception on client

Dec 14, 2010 at 1: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=0.1.0.0, Culture=neutral, PublicKeyToken=35a457c35bdf8fd8'.
Source=RDPAddins
TypeName=RDPAddins.Common.Starter
StackTrace:
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()
InnerException:

[ExportDll("VirtualChannelEntry", CallingConvention.StdCall)]
public static bool VirtualChannelEntry(IntPtr entry)
{
try
{
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 */

app.ExecuteAssembly(assemblyfullpath);

Any ideas ?

Dec 14, 2010 at 10:14 AM
Edited Dec 14, 2010 at 10: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.

HTH

Dec 14, 2010 at 1: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

Bill