firegiant / HeatWaveSupport

Issues-only repository to report HeatWave bugs and feature requests to FireGiant
3 stars 0 forks source link

Delayed wixlib loading causes errors #19

Closed zdavidsen closed 1 year ago

zdavidsen commented 1 year ago

HeatWave Version

0.9.4

Visual Studio Version

17.3.4

Repro Steps

  1. Create a new .wixproj with content similar to the following

    
    <Project Sdk="WixToolset.Sdk/4.0.0-rc.2">
    
    <Target Name="IncludeWixLib" BeforeTargets="PrepareForBuild">
     <ItemGroup>
      <WixLibrary Include="Library.wixlib">
        <Name>%(Filename)</Name>
      </WixLibrary>
    </ItemGroup> 
    </Target>


2. Open the project in visual studio.

### Actual Result

The .wixproj has an error icon overlay, and Visual Studio displays an error banner
![image](https://user-images.githubusercontent.com/22267435/215509728-29331028-ff7b-4873-9fe3-b56b8cfa52c8.png)
<details>
<summary>Log file contents</summary>
=====================</br>
1/30/2023 9:35:30 AM</br>
LimitedFunctionality</br>
System.AggregateException: Project system data flow 'DependenciesChangesDataSource: 13405654' closed because of an exception.</br>
Value cannot be null.</br>
Parameter name: evaluationProperties ---> System.ArgumentNullException: Value cannot be null.</br>
Parameter name: evaluationProperties</br>
   at Microsoft.Requires.NotNull[T](T value, String parameterName)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.IsImplicit(String projectFullPath, IImmutableDictionary`2 evaluationProperties)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.<Handle>g__CreateDependencyModel|10_1(String itemSpec, IProjectRuleSnapshot projectRuleSnapshot, Boolean isResolved, <>c__DisplayClass10_0& A_4)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.<Handle>g__HandleChanges|10_0(Boolean resolved, IProjectChangeDescription projectChange, <>c__DisplayClass10_0& A_3)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.Handle(String projectFullPath, IProjectChangeDescription evaluation, IProjectChangeDescription projectBuild, DependenciesChangesBuilder changesBuilder)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesChangesDataSource.ProcessRuleChange(IProjectVersionedValue`1 data)</br>
   at System.Threading.Tasks.Dataflow.TransformBlock`2.ProcessMessage(Func`2 transform, KeyValuePair`2 messageWithId)</br>
   at System.Threading.Tasks.Dataflow.TransformBlock`2.<>c__DisplayClass9_0.<.ctor>b__3(KeyValuePair`2 messageWithId)</br>
   at System.Threading.Tasks.Dataflow.Internal.TargetCore`1.ProcessMessagesLoopCore()</br>
--- End of stack trace from previous location where exception was thrown ---</br>
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()</br>
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)</br>
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()</br>
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )</br>
   --- End of inner exception stack trace ---</br>
---> (Inner Exception #0) System.ArgumentNullException: Value cannot be null.</br>
Parameter name: evaluationProperties</br>
   at Microsoft.Requires.NotNull[T](T value, String parameterName)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.IsImplicit(String projectFullPath, IImmutableDictionary`2 evaluationProperties)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.<Handle>g__CreateDependencyModel|10_1(String itemSpec, IProjectRuleSnapshot projectRuleSnapshot, Boolean isResolved, <>c__DisplayClass10_0& A_4)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.<Handle>g__HandleChanges|10_0(Boolean resolved, IProjectChangeDescription projectChange, <>c__DisplayClass10_0& A_3)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesRuleHandlerBase.Handle(String projectFullPath, IProjectChangeDescription evaluation, IProjectChangeDescription projectBuild, DependenciesChangesBuilder changesBuilder)</br>
   at FireGiant.HeatWave.ProjectSystem.SolutionExplorer.Dependencies.DependenciesChangesDataSource.ProcessRuleChange(IProjectVersionedValue`1 data)</br>
   at System.Threading.Tasks.Dataflow.TransformBlock`2.ProcessMessage(Func`2 transform, KeyValuePair`2 messageWithId)</br>
   at System.Threading.Tasks.Dataflow.TransformBlock`2.<>c__DisplayClass9_0.<.ctor>b__3(KeyValuePair`2 messageWithId)</br>
   at System.Threading.Tasks.Dataflow.Internal.TargetCore`1.ProcessMessagesLoopCore()</br>
--- End of stack trace from previous location where exception was thrown ---</br>
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()</br>
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)</br>
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()</br>
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---</br>
</br>
===================</br>
</details

### Expected Result

We have several internal wixlib nuget packages that adopted the Target based delayed wixlib loading in order to work around project loading issues with the WiX v3 extension (we derived the method from [WixNuGetPackager](https://www.nuget.org/packages/WixNuGetPackager/)).  It's fairly easy to fix now that we've isolated the issue, but the error message contain no useful hints as to what the problem is.
FireGiantHelp commented 1 year ago

Thank you for the detailed report. We added the issue to our backlog to fix.

FireGiantHelp commented 1 year ago

We have not been able to reproduce this issue. Unfortunately, our versions of Visual Studio were all newer than 17.3.4. So, it is possible this only reproduces with the older Visual Studio or we're missing some step to reproduce.

If you can reproduce this issue with the latest version of Visual Studio, please let us know with any additional steps necessary and we will continue investigating.