this is killing me, still a GetTypes() error

D

Dan Holmes

i have two classes that throw when GetTypes() is executed. The
following are their signatures.

public sealed class ProductService : IAF.TransactionComponent,
IProductService

public sealed class CategoryService :
IAF.Configuration.ConfigurableComponent, ICategoryService

This assembly references the assembly where the interfaces are defined.

public interface ICategoryService
public interface IProductService : IProductServiceBase
public interface IProductServiceBase

This is the exception text

..\IVS.WMS.Product.Server.dll => Could not load type
'IVS.WMS.IProductServiceBase' from assembly 'IVS.WMS.Product.Common,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'IVS.WMS.ICategoryService' from assembly
'IVS.WMS.Product.Common, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.
System.Reflection.ReflectionTypeLoadException: Unable to load one or
more of the requested types. Retrieve the LoaderExc
eptions property for more information.

This is the code that caused it.

Assembly a = Assembly.LoadFrom("IVS.WMS.Product.Server.dll");
Type []t = a.GetTypes(); //this line

I have been stuck on this for at least 2 weeks. I will be happy to mail
anything to anyone if they so desire to help in that way.

dan
 
J

Jon Skeet [C# MVP]

I have been stuck on this for at least 2 weeks. I will be happy to mail
anything to anyone if they so desire to help in that way.

If you can mail me a short but complete program that demonstrates the
program, I'll have a look.

Jon
 
D

Dan Holmes

Dan said:
i have two classes that throw when GetTypes() is executed. The
following are their signatures.

public sealed class ProductService : IAF.TransactionComponent,
IProductService

public sealed class CategoryService :
IAF.Configuration.ConfigurableComponent, ICategoryService

This assembly references the assembly where the interfaces are defined.

public interface ICategoryService
public interface IProductService : IProductServiceBase
public interface IProductServiceBase

This is the exception text

.\IVS.WMS.Product.Server.dll => Could not load type
'IVS.WMS.IProductServiceBase' from assembly 'IVS.WMS.Product.Common,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'IVS.WMS.ICategoryService' from assembly
'IVS.WMS.Product.Common, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.
System.Reflection.ReflectionTypeLoadException: Unable to load one or
more of the requested types. Retrieve the LoaderExc
eptions property for more information.

This is the code that caused it.

Assembly a = Assembly.LoadFrom("IVS.WMS.Product.Server.dll");
Type []t = a.GetTypes(); //this line

I have been stuck on this for at least 2 weeks. I will be happy to mail
anything to anyone if they so desire to help in that way.

dan

I just learned it is machine specific. I copied the dlls to a different
PC and this doesn't happen. I still don't understand.
 
D

Dan Holmes

Jon said:
If you can mail me a short but complete program that demonstrates the
program, I'll have a look.

Jon
Thanks but i finally figured it.

When i rebooted all of VS was freaking out. The IDE was saying all my
plugins couldn't be found including the VS IDE plugin.

The next run of my app produced this:

[c:\sandbox\iaf.net\serverinstall]ApplicationServer.exe

Unhandled Exception: System.Runtime.InteropServices.COMException
(0x80040153): Invalid value for registry (Exception from HRESULT:
0x80040153 (REGDB_E_INVALIDVALUE)) at
System.Runtime.InteropServices.RuntimeEnvironment.GetDeveloperPath()
at System.AppDomain.SetupFusionStore(AppDomainSetup info)
at System.AppDomain.SetupDomain(Boolean allowRedirects, String path,
String configFile)

A quick trip to google produced:

http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic42934.aspx

and a related link here:
http://msdn2.microsoft.com/en-us/library/tyshaw37.aspx

That explains why one pc worked and my main dev pc didn't.

dan
 
B

Boaz Ben-Porat

I had the same problem, and found out that a different version of the
dependecy DLLs were in the GAC. Removing these from the GAC solved the
problem. Is this the case for you?

Boaz Ben-Porat
Milestone Systems A/S
Denmark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top