Commit e937a47
authored
[One .NET] <FixNuGetReferences/> should also work for netstandard2.1 (#5680)
I was attempting to build a project using some brand new Maui NuGet
packages and hit errors such as:
The type or namespace name 'MauiAppCompatActivity' could not be found
The type or namespace name 'MauiApplication<>' could not be found
These types are in:
%userprofile%\.nuget\packages\microsoft.maui.core\6.0.100-preview.2.179\lib\net6.0-android30.0\Microsoft.Maui.dll
Unfortunately, the build actually used the `netstandard2.1` assembly:
%userprofile%\.nuget\packages\microsoft.maui.core\6.0.100-preview.2.179\lib\netstandard2.1\Microsoft.Maui.dll
Our temporary `<FixNuGetReferences/>` MSBuild task should be what
selects the correct assembly, but it didn't.
When we have full NuGet `$(TFM)` support, we won't need this task
at all.
After reviewing the code, I think we need to instead use
`directoryName.StartsWith("netstandard2")`.
I will add a test for this scenario when we have Maui packages we can
consume from a feed. We should build a sample Maui app on our CI.1 parent a75e4c2 commit e937a47
File tree
1 file changed
+1
-1
lines changed- src/Xamarin.Android.Build.Tasks/Tasks
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments