473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

_AppDomain.CreateInstance problem ?

27
I'm working on a COM add-in project for Office. Because I don't want the overheard of VSTO, I'm going with the approach of using a C++ shim, as created by the wizard provided by MS for generating these things. My shim has been tweaked to download one of two separate .NET add-ins depending on which version of the Office app. I've got it working on all the machines I build on, but when installing on a VM it fails to load.

I've traced it down to a failure in my unmanaged CLR Loader's call to CreateInstance. The assembly is signed, and the shim, assembly and a handful of dependent assemblies are all installed in the same folder.
The CLR Loader is creating the _AppDomain object and correctly setting the ApplicationBase folder to where it's all living. Into CreateInstance I'm passing in the correct assembly name, complete with the correct PublicKeyToken value, and the correct class name in the assembly (remember, I have this all working on several other machines).
CreateInstance is returning a "FileNotFound" error. The assembly *is* in the right place, and the classname *is* correct. I fired up 'fuslogvw' based on instructions I found elsewhere, and as I read the log, it's actually correctly loading the assembly.
The implication is that there's "something" that CreateInstance doesn't like about the assembly on this particular machine. I can't tell if maybe there's some dependency that's a problem, or what.

Are there any troubleshooting tips on how I can figure out more precisely why CreateInstance fails in this case?
Mar 22 '07 #1
0 1085

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Osvaldo Bisignano | last post by:
I'm using Assembly.CreateInstance (3rd overload) to create an instance of one of the types included on that dll. But what the hell are the bindingflags? I get this exception: ...
7
by: hazz | last post by:
this is a repost with more concise code (well, for me) and better questions (I hope....) . given the following two classes, my intent is to use either Activator.CreateInstance or InvokeMember pass...
1
by: John Jenkins | last post by:
Hi, I have a fairly simeple question. What are the differences between Assembly.CreateInstance and System.Activator.CreateInstance? I had read that one maps to the other, however when I use...
1
by: dwp | last post by:
hResult = pDefaultDomain->CreateInstanceFrom( pAppDomain- >m_bstrLoadAssemblyName, pAppDomain->m_bstrManagedClass, &pObjectHandle ) This call gives the E_ACCESSDENIED return value. I have...
4
by: Shane | last post by:
I am having a problem where I create an instance of a class from an assembly and I try to cast it to an interface that it inherits from and it says that the cast is invalid. Here is the code: ...
1
by: hazz | last post by:
this is a repost with a hopefully more clearly stated scenario and more concise questions at the end. given the following two classes, my intent is to use pass a token into the instantiated class...
8
by: Dan Holmes | last post by:
Isn't CreateInstance(typeof(int)) the same as CreateInstance<int>()? i don't understand how this method helps anything. dan
1
by: Johnny R | last post by:
Hello, I'm loading a Class from Assemly DLL using Activator.CreateInstance. That loaded Class is executed in a worker Thread with no loop. What actually happends when class is loaded using...
0
by: Jon Skeet [C# MVP] | last post by:
On Apr 11, 8:40 am, Andrew <And...@discussions.microsoft.comwrote: Okay, that means you've either not given the full classname (including namespace) or it's not in mscorlib or the currently...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.