ICorProfilerCallback6::GetAssemblyReferences, méthodeICorProfilerCallback6::GetAssemblyReferences Method

[Pris en charge dans .NET Framework 4.5.2 et ultérieur][Supported in the .NET Framework 4.5.2 and later versions]

Notifie le profileur qu'un assembly en est au tout début du chargement, quand le CLR (Common Langage Runtime) effectue un parcours de fermeture de références d'assembly.Notifies the profiler that an assembly is in a very early loading stage, when the common language runtime performs an assembly reference closure walk.

SyntaxeSyntax

HRESULT GetAssemblyReferences(        [in, string] const WCHAR* wszAssemblyPath,  
        [in] ICorProfilerAssemblyReferenceProvider* pAsmRefProvider  
);  

ParamètresParameters

wszAssemblyPath
[en entrée] Le chemin d’accès et le nom de l’assembly dont les métadonnées seront modifiées.[in] The path and name of the assembly whose metadata will be modified.

pAsmRefProvider
[in] A pointer to the address of an ICorProfilerAssemblyReferenceProvider interface that specifies the assembly references to add.[in] A pointer to the address of an ICorProfilerAssemblyReferenceProvider interface that specifies the assembly references to add.

Valeur de retourReturn Value

Les valeurs retournées depuis ce rappel sont ignorées.Return values from this callback are ignored.

NotesRemarks

This callback is controlled by setting the COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES event mask flag when calling the ICorProfilerCallback5::SetEventMask2 method.This callback is controlled by setting the COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES event mask flag when calling the ICorProfilerCallback5::SetEventMask2 method. If the profiler registers for the ICorProfilerCallback6::GetAssemblyReferences callback method, the runtime passes the path and name of the assembly to be loaded, along with a pointer to an ICorProfilerAssemblyReferenceProvider interface object to that method.If the profiler registers for the ICorProfilerCallback6::GetAssemblyReferences callback method, the runtime passes the path and name of the assembly to be loaded, along with a pointer to an ICorProfilerAssemblyReferenceProvider interface object to that method. The profiler can then call the ICorProfilerAssemblyReferenceProvider::AddAssemblyReference method with a COR_PRF_ASSEMBLY_REFERENCE_INFO object for each target assembly it plans to reference from the assembly specified in the GetAssemblyReferences callback.The profiler can then call the ICorProfilerAssemblyReferenceProvider::AddAssemblyReference method with a COR_PRF_ASSEMBLY_REFERENCE_INFO object for each target assembly it plans to reference from the assembly specified in the GetAssemblyReferences callback.

Utilisez le rappel de GetAssemblyReferences seulement si le profileur doit modifier les métadonnées d'un assembly pour y ajouter des références d'assembly.Use the GetAssemblyReferences callback only if the profiler has to modify an assembly's metadata to add assembly references. (But note that the actual modification of an assembly's metadata is done in the ICorProfilerCallback::ModuleLoadFinishedcallback method.) The profiler should implement the GetAssemblyReferences callback method to inform the common language runtime (CLR) that assembly references will be added when the module has been loaded.(But note that the actual modification of an assembly's metadata is done in the ICorProfilerCallback::ModuleLoadFinishedcallback method.) The profiler should implement the GetAssemblyReferences callback method to inform the common language runtime (CLR) that assembly references will be added when the module has been loaded. Ceci permet de s'assurer que les décisions de partage des assemblys prises par le CLR au cours de cette phase restent valides même si le profileur prévoit de modifier ultérieurement les références d'assembly des métadonnées.This helps ensure that assembly sharing decisions made by the CLR during this early stage remain valid although the profiler plans to modify the metadata assembly references later. Cela permet d'éviter certaines instances où les modifications des métadonnées du profileur provoquent une erreur SECURITY_E_INCOMPATIBLE_SHARE.This can avoid some instances in which profiler metadata modifications cause an SECURITY_E_INCOMPATIBLE_SHARE error.

The profiler uses the ICorProfilerAssemblyReferenceProvider object provided by this method to add assembly references to the CLR assembly reference closure walker.The profiler uses the ICorProfilerAssemblyReferenceProvider object provided by this method to add assembly references to the CLR assembly reference closure walker. The ICorProfilerAssemblyReferenceProvider object should be used only from within this callback.The ICorProfilerAssemblyReferenceProvider object should be used only from within this callback. Calls to the ICorProfilerAssemblyReferenceProvider::AddAssemblyReference method from this callback don't result in modified metadata, but only in a modified assembly reference closure walk.Calls to the ICorProfilerAssemblyReferenceProvider::AddAssemblyReference method from this callback don't result in modified metadata, but only in a modified assembly reference closure walk. The profiler will still have to use an IMetaDataAssemblyEmit object to explicitly add assembly references from within the ICorProfilerCallback::ModuleLoadFinished callback for the referencing assembly, even if it implements the GetAssemblyReferences callback.The profiler will still have to use an IMetaDataAssemblyEmit object to explicitly add assembly references from within the ICorProfilerCallback::ModuleLoadFinished callback for the referencing assembly, even if it implements the GetAssemblyReferences callback.

The profiler should be prepared to receive duplicate calls to this callback for the same assembly, and should respond identically for each such duplicate call (by making the same set of ICorProfilerAssemblyReferenceProvider::AddAssemblyReference calls).The profiler should be prepared to receive duplicate calls to this callback for the same assembly, and should respond identically for each such duplicate call (by making the same set of ICorProfilerAssemblyReferenceProvider::AddAssemblyReference calls).

spécificationsRequirements

Plateformes : Consultez Configuration requise.Platforms: See System Requirements.

En-tête : CorProf.idl, CorProf.hHeader: CorProf.idl, CorProf.h

Bibliothèque : CorGuids.libLibrary: CorGuids.lib

Versions du .NET Framework : Disponible à partir de 4.5.2Available since 4.5.2.NET Framework Versions: Disponible à partir de 4.5.2Available since 4.5.2

Voir aussiSee also