-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
We should not infer ".NETFramework, Version=v0.0" when we encounter a unrecognized Target Framework #798
Comments
Looks like I should be getting:
But we're not. |
I get the cannot infer error and the others.
|
The first one above is cannot infer in French |
I think before my crash fix, we would have found the .NET 4 reference assemblies so you would only have gotten the cannot infer error. |
@davkean Are you sure you're not also getting the cannot infer error? |
I just saw an issue on @jinujoseph's machine where not all errors in output window showed up in error list. I suspect that's why you didn't see the cannot infer error. I do see it in the error list. |
output says this
ErrorList shows doesn't show compatibility error |
Looking into this, I think we currently have two issues: Design-time buildsThe design-time build doesn't run the @davkean How should we make sure this type of target runs in the design time build? Would it make sense for Command-line buildFor command-line builds, the issue is that the @rainersigwald @AndyGerlicher @cdmihai Any idea what could be going on here? |
_CheckForInvalidConfigurationAndPlatform is an initial target right? Wonder if we run initial targets during design-time builds - we probably should. |
It's not an initial target. If it were, I doubt you could avoid running it. |
It's no longer an InitialTarget because that caused problems with Restore: dotnet/msbuild#1280. Nothing springs to mind for the command-line situation--is there a non-minimal repro @dsplaisted? |
@rainersigwald OK, I've narrowed down a repro (or rather two of them). When I try to build a .NET SDK project with an invalid
For the reference assembly error, here's the minimal repro: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Target Name="_CheckForUnsupportedTargetFramework"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform;_CheckCompileDesignTimePrerequisite;GetFrameworkPaths;GetReferenceAssemblyPaths;GenerateBuildRuntimeConfigurationFiles">
<Error Text="Error in _CheckForUnsupportedTargetFramework" />
</Target>
<Target Name="_CheckForInvalidConfigurationAndPlatform" BeforeTargets="$(BuildDependsOn);Build" />
<PropertyGroup>
<BuildDependsOn>
EntityDeploy;
CoreBuild;
</BuildDependsOn>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="CoreBuild" DependsOnTargets="PrepareForBuild;GenerateBuildRuntimeConfigurationFiles"/>
<Target Name="PrepareForBuild" DependsOnTargets="GetReferenceAssemblyPaths"/>
<Target Name="GetReferenceAssemblyPaths">
<Error Text="GetReferenceAssemblyPaths Error" />
</Target>
<Target Name="EntityDeploy" Condition="'@(EntityDeploy)' != ''" />
</Project> In this repro, I would hope that the error in Here's the minimal repro for the assets file not error: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Target Name="_CheckForUnsupportedTargetFramework"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform;_CheckCompileDesignTimePrerequisite;GetFrameworkPaths;GetReferenceAssemblyPaths;GenerateBuildRuntimeConfigurationFiles">
<Error Text="Error in _CheckForUnsupportedTargetFramework" />
</Target>
<Target Name="_CheckForInvalidConfigurationAndPlatform" BeforeTargets="$(BuildDependsOn);Build" />
<PropertyGroup>
<BuildDependsOn>
CoreBuild;
</BuildDependsOn>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="CoreBuild" DependsOnTargets="PrepareForBuild;GenerateBuildRuntimeConfigurationFiles">
<OnError ExecuteTargets="_CleanRecordFileWrites" />
</Target>
<Target Name="PrepareForBuild" DependsOnTargets="GetReferenceAssemblyPaths"/>
<Target Name="GetReferenceAssemblyPaths">
<Error Text="GetReferenceAssemblyPaths Error" />
</Target>
<Target Name="_CheckForCompileOutputs"/>
<Target Name="_CleanGetCurrentAndPriorFileWrites" DependsOnTargets="_CheckForCompileOutputs" />
<Target Name="_CleanRecordFileWrites" DependsOnTargets="_CleanGetCurrentAndPriorFileWrites"/>
<Target Name="GenerateBuildRuntimeConfigurationFiles" BeforeTargets="_CheckForCompileOutputs">
<Error Text="GenerateBuildRuntimeConfigurationFiles Error" />
</Target>
</Project> This is more straightforward, it looks like the |
Should fix the VS side of dotnet/sdk#798
I think we should check that the removal of |
* Added .NET Framework target * Updated BenchmarkDotNet * Waiting for patch: dotnet/sdk#798
#1274, together with dotnet/msbuild#2133, should fix this |
This is working now:
|
…0190721.5 (dotnet#798) - Microsoft.AspNetCore.Mvc.Analyzers - 3.0.0-preview8.19371.5 - Microsoft.AspNetCore.Mvc.Api.Analyzers - 3.0.0-preview8.19371.5 - Microsoft.AspNetCore.Analyzers - 3.0.0-preview8.19371.5 - Microsoft.AspNetCore.Components.Analyzers - 3.0.0-preview8.19371.5
The text was updated successfully, but these errors were encountered: