diff options
-rw-r--r-- | build.proj | 5 | ||||
-rw-r--r-- | lib/DotNetOpenAuth.BuildTasks.dll | bin | 51712 -> 52224 bytes | |||
-rw-r--r-- | lib/DotNetOpenAuth.BuildTasks.pdb | bin | 128512 -> 128512 bytes | |||
-rw-r--r-- | src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs | 11 |
4 files changed, 15 insertions, 1 deletions
@@ -192,6 +192,11 @@ <ProjectTemplatesSource Include="@(ProjectTemplateLibraries)" /> <ProjectTemplatesLayout Include="@(ProjectTemplateLibraries->'$(ProjectTemplatesLayoutPath)lib\%(FileName)%(Extension)')" /> <FixupReferenceAssemblies Include="$(ProjectTemplatesLayoutPath)lib\*.dll" /> + + <!-- force the hint paths to resolve to a path within the project, as required by .vstemplate --> + <FixupReferenceAssemblies> + <HintPath>lib\%(FileName)%(Extension)</HintPath> + </FixupReferenceAssemblies> </ItemGroup> <Trim Inputs="@(_ProjectTemplatesTransformSource)" MetadataName="BeforeTokens" AllAfter="\"> <Output TaskParameter="Outputs" ItemName="ProjectTemplatesTransformSource" /> diff --git a/lib/DotNetOpenAuth.BuildTasks.dll b/lib/DotNetOpenAuth.BuildTasks.dll Binary files differindex b5a0abf..18ef46e 100644 --- a/lib/DotNetOpenAuth.BuildTasks.dll +++ b/lib/DotNetOpenAuth.BuildTasks.dll diff --git a/lib/DotNetOpenAuth.BuildTasks.pdb b/lib/DotNetOpenAuth.BuildTasks.pdb Binary files differindex 30e6562..59600c7 100644 --- a/lib/DotNetOpenAuth.BuildTasks.pdb +++ b/lib/DotNetOpenAuth.BuildTasks.pdb diff --git a/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs b/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs index 4e006a8..c8b039a 100644 --- a/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs +++ b/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs @@ -30,6 +30,11 @@ namespace DotNetOpenAuth.BuildTasks { /// Executes this instance. /// </summary> public override bool Execute() { + if (this.References == null || this.Projects == null || this.References.Length == 0 || this.Projects.Length == 0) { + this.Log.LogMessage(MessageImportance.Low, "Skipping reference hintpath fixup because no projects or no references were supplied."); + return !this.Log.HasLoggedErrors; + } + // Figure out what the assembly names are of the references that are available. AssemblyName[] availableReferences = new AssemblyName[this.References.Length]; for (int i = 0; i < this.References.Length; i++) { @@ -45,7 +50,11 @@ namespace DotNetOpenAuth.BuildTasks { var referenceAssemblyName = new AssemblyName(referenceItem.Include); var matchingReference = availableReferences.FirstOrDefault(r => string.Equals(r.Name, referenceAssemblyName.Name, StringComparison.OrdinalIgnoreCase)); if (matchingReference != null) { - string hintPath = projectUri.MakeRelativeUri(new Uri(matchingReference.CodeBase)).OriginalString.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + var originalSuppliedReferenceItem = this.References[Array.IndexOf(availableReferences, matchingReference)]; + string hintPath = originalSuppliedReferenceItem.GetMetadata("HintPath"); + if (string.IsNullOrEmpty(hintPath)) { + hintPath = projectUri.MakeRelativeUri(new Uri(matchingReference.CodeBase)).OriginalString.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + } this.Log.LogMessage("Fixing up HintPath to \"{0}\" in project \"{1}\".", referenceAssemblyName.Name, projectTaskItem.ItemSpec); referenceItem.SetMetadata("HintPath", hintPath); } |