本文整理汇总了C#中MockEngine.RecordRARExecutionException方法的典型用法代码示例。如果您正苦于以下问题:C# MockEngine.RecordRARExecutionException方法的具体用法?C# MockEngine.RecordRARExecutionException怎么用?C# MockEngine.RecordRARExecutionException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockEngine
的用法示例。
在下文中一共展示了MockEngine.RecordRARExecutionException方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Resolve
public virtual VsResolvedAssemblyPath[] Resolve(IEnumerable<string> assemblies)
{
if (assemblies == null)
{
throw new ArgumentNullException("assemblies");
}
// Resolve references WITHOUT invoking MSBuild to avoid re-entrancy problems.
const bool projectDtar = true;
var rar = new Microsoft.Build.Tasks.ResolveAssemblyReference();
var engine = new MockEngine(EnableLogging);
rar.BuildEngine = engine;
// first set common properties/items then if projectDtar then set additional projectDtar properties
ITaskItem[] assemblyItems = assemblies.Select(assembly => new TaskItem(assembly)).ToArray();
rar.Assemblies = assemblyItems;
rar.SearchPaths = rarInputs.PdtarSearchPaths;
rar.TargetFrameworkDirectories = rarInputs.TargetFrameworkDirectories;
rar.AllowedAssemblyExtensions = rarInputs.AllowedAssemblyExtensions;
rar.TargetProcessorArchitecture = rarInputs.TargetProcessorArchitecture;
rar.TargetFrameworkVersion = rarInputs.TargetFrameworkVersion;
rar.TargetFrameworkMoniker = rarInputs.TargetFrameworkMoniker;
rar.TargetFrameworkMonikerDisplayName = rarInputs.TargetFrameworkMonikerDisplayName;
rar.TargetedRuntimeVersion = rarInputs.TargetedRuntimeVersion;
rar.FullFrameworkFolders = rarInputs.FullFrameworkFolders;
rar.LatestTargetFrameworkDirectories = rarInputs.LatestTargetFrameworkDirectories;
rar.FullTargetFrameworkSubsetNames = rarInputs.FullTargetFrameworkSubsetNames;
rar.FullFrameworkAssemblyTables = rarInputs.FullFrameworkAssemblyTables;
rar.IgnoreDefaultInstalledAssemblySubsetTables = rarInputs.IgnoreDefaultInstalledAssemblySubsetTables;
rar.ProfileName = rarInputs.ProfileName;
rar.Silent = !this.EnableLogging;
rar.FindDependencies = true;
rar.AutoUnify = false;
rar.FindSatellites = false;
rar.FindSerializationAssemblies = false;
rar.FindRelatedFiles = false;
// This set needs to be kept in sync with the set of project instance data that
// is populated into RarInputs
if (projectDtar)
{
// set project dtar specific properties
rar.CandidateAssemblyFiles = rarInputs.CandidateAssemblyFiles;
rar.StateFile = rarInputs.StateFile;
rar.InstalledAssemblySubsetTables = rarInputs.InstalledAssemblySubsetTables;
rar.TargetFrameworkSubsets = rarInputs.TargetFrameworkSubsets;
}
IEnumerable<VsResolvedAssemblyPath> results;
try
{
rar.Execute();
results = FilterResults(rar.ResolvedFiles).Select(pair => new VsResolvedAssemblyPath
{
bstrOrigAssemblySpec = pair.Key,
bstrResolvedAssemblyPath = pair.Value,
});
}
catch (Exception ex)
{
if (ErrorHandler.IsCriticalException(ex))
{
throw;
}
engine.RecordRARExecutionException(ex);
results = Enumerable.Empty<VsResolvedAssemblyPath>();
}
finally
{
if (this.EnableLogging)
{
WriteLogFile(engine, projectDtar, assemblies);
}
}
return results.ToArray();
}