469,592 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

this is killing me, still a GetTypes() error

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
Dec 5 '07 #1
5 6657
On Dec 5, 4:08 pm, Dan Holmes <dhol...@ivsi.comwrote:

<snip>
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
Dec 5 '07 #2
Dan Holmes wrote:
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.
Dec 5 '07 #3
Jon Skeet [C# MVP] wrote:
On Dec 5, 4:08 pm, Dan Holmes <dhol...@ivsi.comwrote:

<snip>
>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
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/m...opic42934.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
Dec 5 '07 #4
Dan Holmes <dh*****@ivsi.comwrote:

<snip>
Thanks but i finally figured it.
Excellent - always nice to hear about a happy ending :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 5 '07 #5
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

"Dan Holmes" <dh*****@ivsi.comskrev i en meddelelse
news:uY**************@TK2MSFTNGP02.phx.gbl...
>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

Dec 5 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by H. S. | last post: by
4 posts views Thread by dave | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.