-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using /p:RestoreUseStaticGraphEvaluation=true Results in Value Cannot Be Null #9280
Comments
Can you please attach a minimal repro that I can investigate? |
I have been unable to make a minimal repo that reproduces the issue yet (the solution in question has ~3500 projects). I have been able to make it further in debugging and can point to this stack trace as being the culprit:
The source in question is here: The project does not have either of these properties:
Meaning outputPath comes back as Here's a redacted version of the project file, but I suspect without all the targets its useless to you: <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Synergy.Traditional.PropertyGroups.msbuild" />
<PropertyGroup>
<AssemblyName>Repository</AssemblyName>
<CommonPropertiesFileLocation>..\Synergy.Traditional.PropertyGroups.msbuild</CommonPropertiesFileLocation>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<EnableCommonProperties>True</EnableCommonProperties>
<IncludeDebugInformation>False</IncludeDebugInformation>
<Name>Repository</Name>
<OutputName>Repository</OutputName>
<OutputType>RPS</OutputType>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Prefer32Bit>False</Prefer32Bit>
<ProjectGuid>{CAE85A2A-F058-464F-9D34-CC16643EC756}</ProjectGuid>
<ProjectTypeGuids>{1BD24377-84D3-44B8-B8F3-81C1EB3E22B4};{BBD0F5D1-1CC4-42FD-BA4C-A96779C64378}</ProjectTypeGuids>
<RepositoryOutput Condition=" '$(RepositoryOutput)' == ''">..\..\bin\rpsdat\</RepositoryOutput>
<RootNamespace>Repository</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<LanguageCompatibilityLevel>10030303</LanguageCompatibilityLevel>
<MOutputName>rpsmain.eng</MOutputName>
<OutputPath>$(RepositoryOutput)</OutputPath>
<PlatformTarget>x86</PlatformTarget>
<TargetRuntimeLevel>10030303</TargetRuntimeLevel>
<TOutputName>rpstext.eng</TOutputName>
<UnevaluatedOutputPath>$(RepositoryOutput)</UnevaluatedOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LanguageCompatibilityLevel>10030303</LanguageCompatibilityLevel>
<MOutputName>rpsmain.eng</MOutputName>
<OutputPath>$(RepositoryOutput)</OutputPath>
<PlatformTarget>x86</PlatformTarget>
<TargetRuntimeLevel>10030303</TargetRuntimeLevel>
<TOutputName>rpstext.eng</TOutputName>
<UnevaluatedOutputPath>$(RepositoryOutput)</UnevaluatedOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="temp.schema" Priority="20" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Synergex\dbl\Synergex.SynergyDE.Repository.targets" />
<PropertyGroup>
<PostBuildEvent></PostBuildEvent>
<PreBuildEvent></PreBuildEvent>
</PropertyGroup>
<Target Name="FixSDI2015Bug" BeforeTargets="CoreCompile">
<Message Text="Fixing Bug Caused By SDI 2501 Not Deleting the Temp Schema" />
<ItemGroup>
<TempSchemaFile Include="$(IntermediateOutputPath)\**\temp.scm" />
</ItemGroup>
<Delete Files="@(TempSchemaFile)" />
</Target>
</Project> Strangely enough attempting to build just this project with the same switches throws no errors? |
Perhaps the best workaround is to set https://github.com/dotnet/msbuild/blob/master/src/Tasks/Microsoft.Common.props#L50 The project is ignored if it doesn't have a |
Near as I can tell this works; I will let the vendor know
Normally I would be able to see this in https://github.com/KirillOsenkov/MSBuildStructuredLog however because this is happening outside of pure MSBuild I can't tell you for sure where this comes from (in the sense that I cannot tell you how it is inherited). Looking at the debugger it looks like at very least the target exists and is being pulled in from NuGet.targets ( What about having some sane default fall back for scenarios like this? or do you think this is uncommon enough? |
If the project imports |
Thanks @jeffkl I am going to close this issue as resolved. Feel free to re-open this or create a new issue if there is code changes to make this more defensive in the above linked method. |
I think we should keep this open until the error message is fixed. I'm fine with the restore failing/crashing, but it should say the issue is with |
Agreed, I'll add a guard against this scenario |
As per #8791 we have been testing with the optional
/p:RestoreUseStaticGraphEvaluation=true
to speed up restores. However we've encountered an issue when this is sent to a project which does not contain any PackageReferences to restore.The command line is:
The redacted error is:
Removing the
/p:RestoreUseStaticGraphEvaluation=true
fixes the issue. As mentioned above this solution actually doesn't have any projects that require a package restore, however out of habit I type/restore
which means I've started to type/p:RestoreUseStaticGraphEvaluation=true
as well. To work around the issue simply avoid the above.The text was updated successfully, but these errors were encountered: