Skip to content
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

Fix Nullable Warnings & projectcacheplugin.csproj now targets net5.0 #6048

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

benvillalobos
Copy link
Member

Fixes CI

Context

Arcade PR passed CI -> projectcache was merged -> Arcade PR was merged using the stale CI success from before projectcache being merged.

Changes Made

ProjectCachePlugin.csproj now targets net5.0.
Microsoft.Build.Engine.UnitTests.csproj assigns net5.0 TargetFramework instead of netcoreapp2.1.
Relaxed nullable warnings that were turned into errors in pipeline builds. @cdmihai please double check ProjectCacheItem.cs for what I did with the nullable warnings.

Testing

CI testing should be enough. If we want to play it safe, an exp/ run should be good validation.

Notes

Fun fact: Apparently, Microsoft.Build.Engine.UnitTests.csproj manually assigns a TargetFramework?

Copy link
Member

@Forgind Forgind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benvillalobos
Copy link
Member Author

@benvillalobos
Copy link
Member Author

The exp/ PR is here: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/298525?_a=overview

It gets passed pipeline build just fine. This should be good to merge.

Comment on lines 43 to 47
<ProjectReference Include="..\Samples\ProjectCachePlugin\ProjectCachePlugin.csproj" Private="false" ReferenceOutputAssembly="false">
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">TargetFramework=$(FullFrameworkTFM)</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(MonoBuild)' == 'true'">TargetFramework=$(FullFrameworkTFM)</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">TargetFramework=netcoreapp2.1</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">TargetFramework=net5.0</SetTargetFramework>
</ProjectReference>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this project reference really needed? It appears to build and run fine without it.

Copy link
Contributor

@cdmihai cdmihai Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow you want to specify that the sample project should be built before the test project. The test project does not have a compile time dependency on it, but a runtime dependency, because the tests are testing whether an arbitrary, previously unknown plugin assembly can be found and its types loaded and instantiated. I had hit issues with this dependency ordering while changing both test and sample, and this ProjectReference is the only way I found to make it work. I think it just happens to work without the ProjectReference because it's also declared in the solution. But that does not guarantee the correct ordering (and I'd rather not specify project ordering in solutions 😇).

@benvillalobos benvillalobos merged commit 4797664 into dotnet:master Jan 20, 2021
@benvillalobos benvillalobos deleted the arcade-update-fixes branch January 20, 2021 16:36
chsienki pushed a commit to chsienki/msbuild that referenced this pull request Jan 28, 2021
…otnet#6048)

Fixes official builds after the arcade update. This failed because arcade CI had merged with a successful (but stale) CI build.
benvillalobos added a commit to benvillalobos/msbuild that referenced this pull request Feb 1, 2021
…otnet#6048)

Fixes official builds after the arcade update. This failed because arcade CI had merged with a successful (but stale) CI build.
benvillalobos added a commit that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants