Skip to content

Conversation

martincostello
Copy link
Member

Fix MSB4109 error when the Microsoft.Extensions.ApiDescription.Server NuGet package is installed with ASP.NET 5 RC1.

C:\Users\martin.costello\.nuget\packages\microsoft.extensions.apidescription.server\5.0.0-rc.1.20451.17\build\Microsoft.Extensions.ApiDescription.Server.targets(5,38): error MSB4109: Expected a property at position 61 in condition " '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND [Project.csproj]
C:\Users\martin.costello\.nuget\packages\microsoft.extensions.apidescription.server\5.0.0-rc.1.20451.17\build\Microsoft.Extensions.ApiDescription.Server.targets(5,38): error MSB4109:       $([MSBuild]::VersionLessThanOrEquals('$(TargetFrameworkVersion)', '2.0') ". Did you forget the closing parenthesis? [Project.csproj]

Appears to have been introduced by #25428.

/cc @dougbu

Fix MSB4109 error when the Microsoft.Extensions.ApiDescription.Server NuGet package is installed.
@ghost ghost added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Sep 14, 2020
@dougbu
Copy link
Contributor

dougbu commented Sep 14, 2020

Whoopsie 🤦 Many thanks @martincostello❕ I'm going to get this in because (obviously) the CI build doesn't validate this *.targets file

@dougbu dougbu merged commit a0ede85 into dotnet:release/5.0 Sep 14, 2020
@martincostello martincostello deleted the patch-1 branch September 14, 2020 19:07
@martincostello
Copy link
Member Author

No problem - I wasn't sure of a test to validate it, but just having the package reference appeared to cause the error. Maybe it can just be referenced inside one of the test projects?

I validated the ) was the right fix by adding it to the targets file in my NuGet package cache and then rebuilding, which resolved it.

For the app where I found the problem I just commented-out the package reference to work around the issue for the time being.

@WhatFreshHellIsThis
Copy link

@martincostello I'm trying to migrate a big project to .net5 and this is the first sticking point, unfortunately commenting out the package in the .csproj file has not resolved the issue I still get the error. Is this cached somewhere, how did you work around it?

@martincostello
Copy link
Member Author

The workaround I did to test the fix will only work locally. I worked around the problem for CI by just commenting-out usages of the NuGet package until the fix comes with RC2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants