本文整理汇总了C#中Microsoft.Build.Shared.AssemblyNameExtension类的典型用法代码示例。如果您正苦于以下问题:C# AssemblyNameExtension类的具体用法?C# AssemblyNameExtension怎么用?C# AssemblyNameExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssemblyNameExtension类属于Microsoft.Build.Shared命名空间,在下文中一共展示了AssemblyNameExtension类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Resolve
public override bool Resolve(AssemblyNameExtension assemblyName, string rawFileNameCandidate, bool isPrimaryProjectReference, bool wantSpecificVersion, string[] executableExtensions, string hintPath, string assemblyFolderKey, ArrayList assembliesConsideredAndRejected, out string foundPath, out bool userRequestedSpecificFile)
{
foundPath = null;
userRequestedSpecificFile = false;
if (rawFileNameCandidate != null)
{
if (base.fileExists(rawFileNameCandidate))
{
userRequestedSpecificFile = true;
foundPath = rawFileNameCandidate;
return true;
}
if (assembliesConsideredAndRejected != null)
{
ResolutionSearchLocation location = null;
location = new ResolutionSearchLocation {
FileNameAttempted = rawFileNameCandidate,
SearchPath = base.searchPathElement,
Reason = NoMatchReason.NotAFileNameOnDisk
};
assembliesConsideredAndRejected.Add(location);
}
}
return false;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:RawFilenameResolver.cs
示例2: ResolveFromDirectory
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assemblyname of the reference.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
public override bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
)
{
foundPath = null;
userRequestedSpecificFile = false;
// Resolve to the given path.
string resolvedPath = ResolveFromDirectory(assemblyName, isPrimaryProjectReference, wantSpecificVersion, executableExtensions, searchPathElement, assembliesConsideredAndRejected);
if (resolvedPath != null)
{
foundPath = resolvedPath;
return true;
}
return false;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:44,代码来源:DirectoryResolver.cs
示例3: Resolve
public override bool Resolve(AssemblyNameExtension assemblyName, string rawFileNameCandidate, bool isPrimaryProjectReference, bool wantSpecificVersion, string[] executableExtensions, string hintPath, string assemblyFolderKey, ArrayList assembliesConsideredAndRejected, out string foundPath, out bool userRequestedSpecificFile)
{
foundPath = null;
userRequestedSpecificFile = false;
if (assemblyName != null)
{
string path = GlobalAssemblyCache.GetLocation(assemblyName, base.targetProcessorArchitecture, base.getRuntimeVersion, base.targetedRuntimeVersion, false, base.fileExists, null, null, wantSpecificVersion);
if (((path != null) && (path.Length > 0)) && base.fileExists(path))
{
foundPath = path;
return true;
}
if (assembliesConsideredAndRejected != null)
{
ResolutionSearchLocation location = new ResolutionSearchLocation {
FileNameAttempted = assemblyName.FullName,
SearchPath = base.searchPathElement,
AssemblyName = assemblyName,
Reason = NoMatchReason.NotInGac
};
assembliesConsideredAndRejected.Add(location);
}
}
return false;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:GacResolver.cs
示例4:
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assemblyname of the reference.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
public override bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
)
{
if (hintPath != null && hintPath.Length > 0)
{
if (ResolveAsFile(hintPath, assemblyName, isPrimaryProjectReference, wantSpecificVersion, true, assembliesConsideredAndRejected))
{
userRequestedSpecificFile = true;
foundPath = hintPath;
return true;
}
}
foundPath = null;
userRequestedSpecificFile = false;
return false;
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:44,代码来源:HintPathResolver.cs
示例5: Execute
public override bool Execute()
{
FrameworkName frameworkmoniker = null;
FrameworkName name2 = null;
bool flag = false;
try
{
frameworkmoniker = new FrameworkName(this.TargetFrameworkMoniker);
flag = !string.IsNullOrEmpty(frameworkmoniker.Profile);
if (flag)
{
name2 = new FrameworkName(frameworkmoniker.Identifier, frameworkmoniker.Version);
}
if ((!this.bypassFrameworkInstallChecks && frameworkmoniker.Identifier.Equals(".NETFramework", StringComparison.OrdinalIgnoreCase)) && (frameworkmoniker.Version.Major < 4))
{
if (!net35SP1SentinelAssemblyFound.HasValue)
{
AssemblyNameExtension strongName = new AssemblyNameExtension(NET35SP1SentinelAssemblyName);
net35SP1SentinelAssemblyFound = new bool?(!string.IsNullOrEmpty(GlobalAssemblyCache.GetLocation(strongName, System.Reflection.ProcessorArchitecture.MSIL, runtimeVersion => "v2.0.50727", new Version("2.0.57027"), false, new Microsoft.Build.Shared.FileExists(Microsoft.Build.Shared.FileUtilities.FileExistsNoThrow), GlobalAssemblyCache.pathFromFusionName, GlobalAssemblyCache.gacEnumerator, false)));
}
if (!net35SP1SentinelAssemblyFound.Value)
{
base.Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.NETFX35SP1NotIntstalled", new object[] { this.TargetFrameworkMoniker });
}
}
}
catch (ArgumentException exception)
{
base.Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.InvalidTargetFrameworkMoniker", new object[] { this.TargetFrameworkMoniker, exception.Message });
return false;
}
try
{
this.tfmPaths = this.GetPaths(this.rootPath, frameworkmoniker);
if ((this.tfmPaths != null) && (this.tfmPaths.Count > 0))
{
this.TargetFrameworkMonikerDisplayName = ToolLocationHelper.GetDisplayNameForTargetFrameworkDirectory(this.tfmPaths[0], frameworkmoniker);
}
if (flag && (this.tfmPaths != null))
{
this.tfmPathsNoProfile = this.GetPaths(this.rootPath, name2);
}
if (!flag)
{
this.tfmPathsNoProfile = this.tfmPaths;
}
}
catch (Exception exception2)
{
base.Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.ProblemGeneratingReferencePaths", new object[] { this.TargetFrameworkMoniker, exception2.Message });
if (Microsoft.Build.Shared.ExceptionHandling.IsCriticalException(exception2))
{
throw;
}
this.tfmPathsNoProfile = null;
this.TargetFrameworkMonikerDisplayName = null;
}
return !base.Log.HasLoggedErrors;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:59,代码来源:GetReferenceAssemblyPaths.cs
示例6: foreach
/// <summary>
/// Implementation guts for ResolveReference.
/// </summary>
/// <param name="jaggedResolvers">The array of resolvers to search with.</param>
/// <param name="assemblyName">The assembly name to look up.</param>
/// <param name="rawFileNameCandidate">The file name to match if {RawFileName} is seen. (May be null).</param>
/// <param name="isPrimaryProjectReference">True if this is a primary reference directly from the project file.</param>
/// <param name="executableExtensions">The filename extension of the assembly. Must be this or its no match.</param>
/// <param name="hintPath">This reference's hintpath</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="resolvedSearchPath">Receives the searchPath that the reference was resolved at. Empty if not resolved.</param>
/// <param name="userRequestedSpecificFile"> This will be true if the user requested a specific file.</param>
/// <returns>The resolved path</returns>
internal static string ResolveReference
(
IEnumerable<Resolver[]> jaggedResolvers,
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string resolvedSearchPath,
out bool userRequestedSpecificFile
)
{
// Initialize outs.
userRequestedSpecificFile = false;
resolvedSearchPath = String.Empty;
// Search each group of resolvers
foreach (Resolver[] resolvers in jaggedResolvers)
{
// Tolerate null resolvers.
if (resolvers == null)
{
break;
}
// Search each searchpath.
foreach (Resolver resolver in resolvers)
{
string fileLocation;
if
(
resolver.Resolve
(
assemblyName,
sdkName,
rawFileNameCandidate,
isPrimaryProjectReference,
wantSpecificVersion,
executableExtensions,
hintPath,
assemblyFolderKey,
assembliesConsideredAndRejected,
out fileLocation,
out userRequestedSpecificFile
)
)
{
resolvedSearchPath = resolver.SearchPath;
return fileLocation;
}
}
}
return null;
}
开发者ID:ChronosWS,项目名称:msbuild,代码行数:73,代码来源:AssemblyResolution.cs
示例7: CheckForFullFusionNameInGac
private static string CheckForFullFusionNameInGac(AssemblyNameExtension assemblyName, string targetProcessorArchitecture, GetPathFromFusionName getPathFromFusionName)
{
string fullName = assemblyName.FullName;
if ((targetProcessorArchitecture != null) && !assemblyName.HasProcessorArchitectureInFusionName)
{
fullName = fullName + ", ProcessorArchitecture=" + targetProcessorArchitecture;
}
return getPathFromFusionName(fullName);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:GlobalAssemblyCache.cs
示例8: CheckForAssemblyInGac
private bool CheckForAssemblyInGac(AssemblyNameExtension assemblyName, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, Microsoft.Build.Shared.FileExists fileExists)
{
string str = null;
if (assemblyName.Version != null)
{
str = GlobalAssemblyCache.GetLocation(assemblyName, targetProcessorArchitecture, getRuntimeVersion, targetedRuntimeVersion, true, fileExists, null, null, false);
}
return (str != null);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ResolveAssemblyReference.cs
示例9: UnifiedAssemblyName
public UnifiedAssemblyName(AssemblyNameExtension preUnified, AssemblyNameExtension postUnified, bool isUnified, UnificationReason unificationReason, bool isPrerequisite, bool? isRedistRoot, string redistName)
{
_preUnified = preUnified;
_postUnified = postUnified;
_isUnified = isUnified;
_isPrerequisite = isPrerequisite;
_isRedistRoot = isRedistRoot;
_redistName = redistName;
_unificationReason = unificationReason;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:10,代码来源:UnifiedAssemblyName.cs
示例10: UnifiedAssemblyName
public UnifiedAssemblyName(AssemblyNameExtension preUnified, AssemblyNameExtension postUnified, bool isUnified, Microsoft.Build.Tasks.UnificationReason unificationReason, bool isPrerequisite, bool? isRedistRoot, string redistName)
{
this.preUnified = preUnified;
this.postUnified = postUnified;
this.isUnified = isUnified;
this.isPrerequisite = isPrerequisite;
this.isRedistRoot = isRedistRoot;
this.redistName = redistName;
this.unificationReason = unificationReason;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:UnifiedAssemblyName.cs
示例11: GetAssemblyMetadata
private void GetAssemblyMetadata(string path, out AssemblyNameExtension[] dependencies, out string[] scatterFiles)
{
FileState fileState = this.GetFileState(path);
if (fileState.dependencies == null)
{
this.getAssemblyMetadata(path, out fileState.dependencies, out fileState.scatterFiles);
this.isDirty = true;
}
dependencies = fileState.dependencies;
scatterFiles = fileState.scatterFiles;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:SystemState.cs
示例12: FindHighestVersionInRedistList
internal AssemblyEntry FindHighestVersionInRedistList(AssemblyNameExtension assemblyName)
{
foreach (AssemblyEntry entry in this.redistList.FindAssemblyNameFromSimpleName(assemblyName.Name))
{
if (entry.AssemblyNameExtension.EqualsIgnoreVersion(assemblyName))
{
return entry;
}
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:InstalledAssemblies.cs
示例13: GetLocation
internal static string GetLocation(AssemblyNameExtension strongName, ProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, bool fullFusionName, Microsoft.Build.Shared.FileExists fileExists, GetPathFromFusionName getPathFromFusionName, GetGacEnumerator getGacEnumerator, bool specificVersion)
{
string str = null;
if (((strongName.GetPublicKeyToken() == null) || (strongName.GetPublicKeyToken().Length == 0)) && (strongName.FullName.IndexOf("PublicKeyToken", StringComparison.OrdinalIgnoreCase) != -1))
{
return str;
}
getPathFromFusionName = getPathFromFusionName ?? pathFromFusionName;
getGacEnumerator = getGacEnumerator ?? gacEnumerator;
if (!strongName.HasProcessorArchitectureInFusionName)
{
if ((targetProcessorArchitecture != ProcessorArchitecture.MSIL) && (targetProcessorArchitecture != ProcessorArchitecture.None))
{
string str2 = ResolveAssemblyReference.ProcessorArchitectureToString(targetProcessorArchitecture);
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, str2, getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, str2, getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
}
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, "MSIL", getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, "MSIL", getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
}
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, null, getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, null, getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:54,代码来源:GlobalAssemblyCache.cs
示例14: AddToDependencyGraph
private static void AddToDependencyGraph(Dictionary<Reference, List<ReferenceAssemblyExtensionPair>> dependencyGraph, AssemblyNameExtension assemblyName, Reference assemblyReference)
{
foreach (Reference reference in assemblyReference.GetDependees())
{
List<ReferenceAssemblyExtensionPair> list = null;
if (!dependencyGraph.TryGetValue(reference, out list))
{
list = new List<ReferenceAssemblyExtensionPair>();
dependencyGraph.Add(reference, list);
}
list.Add(new ReferenceAssemblyExtensionPair(assemblyReference, assemblyName));
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ReferenceTable.cs
示例15:
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assemblyname of the reference.</param>
/// <param name="sdkName">The name of the sdk to resolve.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
abstract public bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
);
开发者ID:cameron314,项目名称:msbuild,代码行数:30,代码来源:Resolver.cs
示例16: FindHighestVersionInRedistList
/// <summary>
/// Unify an assembly name according to the fx retarget rules.
/// </summary>
/// <param name="assemblyName">The unify-from assembly name.</param>
/// <param name="unifiedVersion">The new version number.</param>
/// <param name="isPrerequisite">Whether this assembly will be available on target machines.</param>
/// <param name="isRedistRoot">May be true, false or null. Null means there was no IsRedistRoot in the redist list.</param>
/// <param name="redistName">Name of the corresponding Resist specified in the redist list.</param>
internal void GetInfo
(
AssemblyNameExtension assemblyName,
out Version unifiedVersion,
out bool isPrerequisite,
out bool? isRedistRoot,
out string redistName
)
{
unifiedVersion = assemblyName.Version;
isPrerequisite = false;
isRedistRoot = null;
redistName = null;
// Short-circuit in cases where there is no redist list.
if (_redistList == null)
{
return;
}
// If there's no version, for example in a simple name, then no remapping is possible,
// and this is not a prerequisite.
if (assemblyName.Version == null)
{
return;
}
AssemblyEntry highestVersionFromRedistList = FindHighestVersionInRedistList(assemblyName);
// Could not find the assembly in the redist list. Return as there has been no redist list unification
if (highestVersionFromRedistList == null)
{
return;
}
// Dont allow downgrading of reference version due to redist unification because this is automatic rather than something like an appconfig which
// has to be manually set. However if the major version is 255 then we do want to unify down the version number.
if (assemblyName.Version <= highestVersionFromRedistList.AssemblyNameExtension.Version || assemblyName.Version.Major == 255)
{
unifiedVersion = highestVersionFromRedistList.AssemblyNameExtension.Version;
isPrerequisite = _redistList.IsPrerequisiteAssembly(highestVersionFromRedistList.FullName);
isRedistRoot = _redistList.IsRedistRoot(highestVersionFromRedistList.FullName);
redistName = _redistList.RedistName(highestVersionFromRedistList.FullName);
return;
}
}
开发者ID:cameron314,项目名称:msbuild,代码行数:56,代码来源:InstalledAssemblies.cs
示例17: ResolutionSearchLocation
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assembly name object of the assembly.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
public override bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
)
{
foundPath = null;
userRequestedSpecificFile = false;
if (assemblyName != null)
{
// {GAC} was passed in.
string gacResolved = _getAssemblyPathInGac(assemblyName, targetProcessorArchitecture, getRuntimeVersion,
targetedRuntimeVersion, fileExists, fullFusionName: false, specificVersion: wantSpecificVersion);
if (!string.IsNullOrEmpty(gacResolved) && fileExists(gacResolved))
{
foundPath = gacResolved;
return true;
}
else
{
// Record this as a location that was considered.
if (assembliesConsideredAndRejected != null)
{
ResolutionSearchLocation considered = new ResolutionSearchLocation();
considered.FileNameAttempted = assemblyName.FullName;
considered.SearchPath = searchPathElement;
considered.AssemblyName = assemblyName;
considered.Reason = NoMatchReason.NotInGac;
assembliesConsideredAndRejected.Add(considered);
}
}
}
return false;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:61,代码来源:GacResolver.cs
示例18: ResolutionSearchLocation
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assemblyname of the reference.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
public override bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
)
{
foundPath = null;
userRequestedSpecificFile = false;
if (rawFileNameCandidate != null)
{
// {RawFileName} was passed in.
if (fileExists(rawFileNameCandidate))
{
userRequestedSpecificFile = true;
foundPath = rawFileNameCandidate;
return true;
}
else
{
if (assembliesConsideredAndRejected != null)
{
ResolutionSearchLocation considered = null;
considered = new ResolutionSearchLocation();
considered.FileNameAttempted = rawFileNameCandidate;
considered.SearchPath = searchPathElement;
considered.Reason = NoMatchReason.NotAFileNameOnDisk;
assembliesConsideredAndRejected.Add(considered);
}
}
}
return false;
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:59,代码来源:RawFilenameResolver.cs
示例19: ResolutionSearchLocation
/// <summary>
/// Resolve a reference to a specific file name.
/// </summary>
/// <param name="assemblyName">The assemblyname of the reference.</param>
/// <param name="rawFileNameCandidate">The reference's 'include' treated as a raw file name.</param>
/// <param name="isPrimaryProjectReference">Whether or not this reference was directly from the project file (and therefore not a dependency)</param>
/// <param name="wantSpecificVersion">Whether an exact version match is requested.</param>
/// <param name="executableExtensions">Allowed executable extensions.</param>
/// <param name="hintPath">The item's hintpath value.</param>
/// <param name="assemblyFolderKey">Like "hklm\Vendor RegKey" as provided to a reference by the <AssemblyFolderKey> on the reference in the project.</param>
/// <param name="candidateAssemblyFiles">List of literal assembly file names to be considered when SearchPaths has {CandidateAssemblyFiles}.</param>
/// <param name="assembliesConsideredAndRejected">Receives the list of locations that this function tried to find the assembly. May be "null".</param>
/// <param name="foundPath">The path where the file was found.</param>
/// <param name="userRequestedSpecificFile">Whether or not the user wanted a specific file (for example, HintPath is a request for a specific file)</param>
/// <returns>True if the file was resolved.</returns>
public override bool Resolve
(
AssemblyNameExtension assemblyName,
string sdkName,
string rawFileNameCandidate,
bool isPrimaryProjectReference,
bool wantSpecificVersion,
string[] executableExtensions,
string hintPath,
string assemblyFolderKey,
ArrayList assembliesConsideredAndRejected,
out string foundPath,
out bool userRequestedSpecificFile
)
{
foundPath = null;
userRequestedSpecificFile = false;
if (assemblyName != null)
{
// {GAC} was passed in.
string gacResolved = GlobalAssemblyCache.GetLocation(_buildEngine, assemblyName, targetProcessorArchitecture, getRuntimeVersion, targetedRuntimeVersion, false /*may not be a fusion name*/, fileExists, null /*Use default delegate in method*/, null /*Use default delegate in method*/, wantSpecificVersion);
if (gacResolved != null && gacResolved.Length > 0 && fileExists(gacResolved))
{
foundPath = gacResolved;
return true;
}
else
{
// Record this as a location that was considered.
if (assembliesConsideredAndRejected != null)
{
ResolutionSearchLocation considered = new ResolutionSearchLocation();
considered.FileNameAttempted = assemblyName.FullName;
considered.SearchPath = searchPathElement;
considered.AssemblyName = assemblyName;
considered.Reason = NoMatchReason.NotInGac;
assembliesConsideredAndRejected.Add(considered);
}
}
}
return false;
}
开发者ID:ChronosWS,项目名称:msbuild,代码行数:60,代码来源:GacResolver.cs
示例20: GetInfo
internal void GetInfo(AssemblyNameExtension assemblyName, out Version unifiedVersion, out bool isPrerequisite, out bool? isRedistRoot, out string redistName)
{
unifiedVersion = assemblyName.Version;
isPrerequisite = false;
isRedistRoot = 0;
redistName = null;
if ((this.redistList != null) && (assemblyName.Version != null))
{
AssemblyEntry entry = this.FindHighestVersionInRedistList(assemblyName);
if ((entry != null) && (assemblyName.Version <= entry.AssemblyNameExtension.Version))
{
unifiedVersion = entry.AssemblyNameExtension.Version;
isPrerequisite = this.redistList.IsPrerequisiteAssembly(entry.FullName);
isRedistRoot = this.redistL
|
请发表评论