In This Article

IProjectAssemblyReferenceCollection Interface

Provides the base requirements for a collection of IProjectAssemblyReference objects.

public interface IProjectAssemblyReferenceCollection : IObservableCollection<IProjectAssemblyReference>

Properties

this[IAssemblyName]

Gets the IProjectAssemblyReference for the assembly with the specified name.

[C#] In C#, this property is the indexer for the IProjectAssemblyReferenceCollection class.

IProjectAssemblyReference this[IAssemblyName assemblyName] { get; }
Parameter Type Description
assemblyName IAssemblyName

The IAssemblyName of the assembly to return.

Property Value

IProjectAssemblyReference:

The IProjectAssemblyReference for the assembly with the specified name.

this[string]

Gets the IProjectAssemblyReference for the assembly with the specified full name.

[C#] In C#, this property is the indexer for the IProjectAssemblyReferenceCollection class.

IProjectAssemblyReference this[string fullName] { get; }
Parameter Type Description
fullName string

The full name of the IProjectAssemblyReference to return.

Property Value

IProjectAssemblyReference:

The IProjectAssemblyReference for the assembly with the specified full name.

Methods

Add(IAssembly)

Adds a new reference for the specified IAssembly.

IProjectAssemblyReference Add(IAssembly assembly)
Parameter Type Description
assembly IAssembly

The IAssembly to reference.

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

Add(Assembly)

Adds a new reference to an IBinaryAssembly for the specified reflection Assembly.

IProjectAssemblyReference Add(Assembly assembly)
Parameter Type Description
assembly Assembly

The reflection Assembly to reference.

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

Add(Assembly, IAssemblyName)

Adds a new reference to an IBinaryAssembly for the specified reflection Assembly, but stores it with an alternate IAssemblyName, which is useful for dynamically generated assemblies.

IProjectAssemblyReference Add(Assembly assembly, IAssemblyName assemblyName)
Parameter Type Description
assembly Assembly

The reflection Assembly to reference.

assemblyName IAssemblyName

The alternate IAssemblyName to use.

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

Add(string)

Adds a new reference to an IBinaryAssembly for the specified assembly name.

IProjectAssemblyReference Add(string fullName)
Parameter Type Description
fullName string

The full name of the assembly to reference.

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

Remarks

While using the simple assembly name may work in some simple cases (such as System), it is highly recommended to pass the fully-qualified assembly name to this method (such as System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) since the probing code will have a better chance of successfully finding it.

AddAllInAppDomain()

Adds new references to IBinaryAssembly objects for all assemblies currently loaded in the AppDomain.

IEnumerable<IProjectAssemblyReference> AddAllInAppDomain()

Returns

IEnumerable<IProjectAssemblyReference>:

The collection of IProjectAssemblyReference objects that were created.

Remarks

This method is only recommended for testing purposes since a properly-designed application should pick and choose which exact assembly references to have on a project assembly.

AddFrom(string)

Adds a new reference to an IBinaryAssembly for the assembly at the specified path.

IProjectAssemblyReference AddFrom(string path)
Parameter Type Description
path string

The path to the Assembly file to reference.

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

AddMsCorLib()

Adds a new reference to an IBinaryAssembly for mscorlib.

IProjectAssemblyReference AddMsCorLib()

Returns

IProjectAssemblyReference:

The IProjectAssemblyReference that was created.

Inherited Members