| Profil de xiong共享空间标题PhotosBlogListes | Aide |
|
31 janvier How to load assembly into shared domain in CLR1I am not quite sure why we cannot load one assembly into a appDomain if the assembly is alreadly loaded in sharedomain, if the security resctriction in the two appDomain differs. If we do so, we will get the "security permission grant set is incompatible between appdomains" exception.
You may ask how to load a customer assembly into shared domain. One customer shows the way:
int _tmain(int argc, _TCHAR* argv[]) HRESULT hr = S_OK; hr = CoInitialize(NULL); // Load the net framework if (FAILED(hr) || !pHost) hr = pHost->GetDefaultDomain(&pAppDomainUnkPrimary ); hr = pAppDomainUnkPrimary->QueryInterface(__uuidof(_AppDomain), hr = pPrimaryDomain->CreateInstance(
Here, the ManagedHost is loaded into the SharedDomain, and the CreateInstance function call also creates a new domain, where the ManagedHost is loaded again.
However, in CLR2.0, with the same code, the ManagedHost will not be loaded into ShareadDomain anymore, thus I assume the exception can be avoided.
In fact, this topic is far away from the original quesiton the customer asked. The customer wants to challange the following MSDN statements marked red based on the test:
http://spaces.msn.com/eparg/blog/cns!59BFC22C0E7E1A76!525.entry Commentaires (6)Pour ajouter un commentaire, connectez-vous avec votre identifiant Windows Live ID (si vous utilisez Messenger ou Xbox LIVE, vous avez un identifiant Windows Live ID). Connectez-vous Vous n'avez pas d'identifiant Windows Live ID ? Inscrivez-vous
RétroliensL'URL de rétrolien de ce billet est : http://eparg.spaces.live.com/blog/cns!59BFC22C0E7E1A76!525.trak Blogs Web qui font référence à ce billet
|
|
|