Dear All, Dear Tomas (My feeling is that you could like this for me very
complicated question).
I want at the run time resolve one of the added reference assemblies, but
the approach fails. fuslogvw shows, that
TypeAddedToReferencesButNotInTheRightPath couldn't be found, even before
the message box pops up.
Did I missed somethig? I found
(http://www.codeproject.com/dotnet/loadpoly.asp), which seems to do quite
the same. Why CLR tries to load this type before it is used?
Please help me,
With best regards,
Boni
__gc public class test:
{
private:
Assembly * ResolveMe(Object *sender, System::ResolveEventArgs* args);
System::ResolveEventHandler* m_ResolveEventHandler;
Object __gc * pDynamic;
void test()
}
test::test()
{
MessageBox::Show("I am in costructor")
AppDomain::CurrentDomain->AssemblyResolve += new ResolveEventHandler(this,
ResolveMe);
pDynamic= new TypeAddedToReferencesButNotInTheRightPath
dynamic_cast<TypeAddedToReferencesButNotInTheRightPath*>(pDynamic)->Helloo();
}
Vladimir Nesterovsky - 11 May 2005 20:25 GMT
> Dear All, Dear Tomas (My feeling is that you could like this for me very
> complicated question).
[quoted text clipped - 34 lines]
>
> pDynamic= new TypeAddedToReferencesButNotInTheRightPath
dynamic_cast<TypeAddedToReferencesButNotInTheRightPath*>(pDynamic)->Helloo()
;
> }
I believe CLR resolves types at JIT time (at the first enter to the
test::test()). If you will separate first type access with installation of
AssemblyResolve event you possibly will succeed.
test::test()
{
MessageBox::Show("I am in costructor")
AppDomain::CurrentDomain->AssemblyResolve +=
new ResolveEventHandler(this, ResolveMe);
DoIt();
}
test::DoIt()
{
TypeAddedToReferencesButNotInTheRightPath *dynamic =
new TypeAddedToReferencesButNotInTheRightPath;
}
--
Vladimir Nesterovsky
e-mail: vladimir@nesterovsky-bros.com
home: http://www.nesterovsky-bros.com
Boni - 12 May 2005 08:06 GMT
Hi Vladimir,
you are right!!!!! Thaniks for the solution and for the link on your web
page to the comparision of source controls.
Best regards,
Boni
>> Dear All, Dear Tomas (My feeling is that you could like this for me very
>> complicated question).
[quoted text clipped - 65 lines]
> e-mail: vladimir@nesterovsky-bros.com
> home: http://www.nesterovsky-bros.com