Open MichaWiedenmann opened 8 years ago
Same basic problem as #4493. Unfortunately, nobody's currently working on Votive bugs.
I've noticed that AddIndependentFileNode
has a check to see if the item is in the project hierarchy, however it uses item.Xml.Include
, which evaluates to "$(SolutionDir)" and the path comparisons don't make any sense. For reference, this is the check its trying to make:
// Make sure the item is within the project folder hierarchy. If not, link it.
string linkPath = item.GetMetadataValue(ProjectFileConstants.Link);
if (String.IsNullOrEmpty(linkPath))
{
string projectFolder = new Uri(this.ProjectFolder).LocalPath;
string itemPath = new Uri(Path.Combine(this.ProjectFolder, item.Xml.Include)).LocalPath;
if (!itemPath.StartsWith(projectFolder, StringComparison.OrdinalIgnoreCase))
{
shouldLink = true;
}
}
GetItemParentNode
uses item.EvaluatedInclude
instead - if I swap out the item.Xml.Include
for item.EvaluatedInclude
I no longer get the load failure and the node appears as a link, matching the behaviour of a C# project.
If the variable resolves to a folder rather than a file, it appears as a blank link (C# projects handle this by not displaying the item).
Is this the right approach? (I'm not especially familiar with VSX development). If it is I'll submit a PR.
Almost 3 Years later and my session grinds to a halt after running into this exact bug... Although absolutely nothing works for me, be it relative OR absolute.
Judging by the metric ton of out-dated and misleading info around the web its looking more and more like having to manually write out 1000's of file refs/components. The joy.
This issue is open and unassigned. That means it is waiting for someone to investigate the root problem, discuss possible solutions to that problem then implement the decided solution.
If you are interested in doing so yourself, our developer documentation provides a great checklist for getting started.
If you are not interested then you are waiting for someone else to become interested. Since this issue has been open for a long time then there probably isn't much interest in this particular issue. In that case, you'll want to consider how to motivate others to fix it for you or consider commercial alternatives.
Normally i would have jumped right in, but considering i already have far too much to do already, joining a mailing list and submitting proposals etc just for a bug fix is a little too many hoops to jump through, (Could also be the reason no-one else has tried either, just saying).
But then again, i havn't touched a VS Extension in years, they were becoming quite a horrible mess of COM junk and undocumented classes/interfaces each with 20 similar variants, doubt that's changed any.
Since its been so long, i would love to hear how people are working around it then? Considering its quite the show-stopper, atm im looking at just using HeatDirectory itself and creating a custom task to include the results.
Only other option i could see is using the command line directly, maybe in a seperate build task.
Anywho, apologies for resurrecting this in such a fashion :)
FYI, inserting a <Link> element within <HarvestDirectory> prevents the error message.
I think I have tracked down a crash when loading a WiX project in Visual Studio, which seems to be related to properties. Consider the following definition:
This builds with MSBuild (from the command line) but loading the solution in Visual Studio 2010 fails with the following error:
If I replace the property with a constant path (
H:\temp\Setup\
), the project does load.$(SolutionDir)
points to "H:\temp\Setup\".HarvestDirectory
withFoo
shows the same behavior, therefore this issue is probably unreleated toHarvestDirectory
.$(SolutionDir)
with$(ProjectDir)
does load."CreateFolderNodes path"
is used in the WiX code.The code at
src/Votive/votive2010/vssdk/projectnode.cs
suggests, that the path must be subdirectory of the project:// Ensure we are using a relative path if (String.Compare(this.ProjectFolder, 0, path, 0, this.ProjectFolder.Length, StringComparison.OrdinalIgnoreCase) != 0) throw new ArgumentException(SR.GetString(SR.InvalidParameter, CultureInfo.CurrentUICulture), "CreateFolderNodes path");
However, I don't understand, why the constant path works.
$(SourceDir)
property to set the source path from the outside.)I still wonder though:
Hope this helps, Micha
This is my
.wixproj
file: