Skip to content

Conversation

@pjcollins
Copy link
Member

I've been hitting errors running tests locally on Windows after building
with .NET 6 Preview 3:

Error Message:
 System.IO.FileNotFoundException : Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Stack Trace:
   at Xamarin.ProjectTools.DotNetXamarinProject.SaveProject()
 at Xamarin.ProjectTools.XamarinProject.Save(Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\XamarinProject.cs:line 241
 at Xamarin.ProjectTools.ProjectBuilder.Save(XamarinProject project, Boolean doNotCleanupOnUpdate, Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 43
 at Xamarin.ProjectTools.ProjectBuilder.Build(XamarinProject project, Boolean doNotCleanupOnUpdate, String[] parameters, Boolean saveProject, Dictionary`2 environmentVariables) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 67
 at Xamarin.Android.Build.Tests.WearTests.ResolveLibraryImportsWithReadonlyFiles() in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\WearTests.cs:line 28

Rather than copying the version of the MSBuild assemblies used to build
our test projects to the output directory, we should be able to use the
NuGet package content directly. These files should only be used by our
project creation APIs and as a result their version shouldn't matter.

I've been hitting errors running tests locally on Windows after building
with .NET 6 Preview 3:

    Error Message:
     System.IO.FileNotFoundException : Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
    Stack Trace:
       at Xamarin.ProjectTools.DotNetXamarinProject.SaveProject()
     at Xamarin.ProjectTools.XamarinProject.Save(Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\XamarinProject.cs:line 241
     at Xamarin.ProjectTools.ProjectBuilder.Save(XamarinProject project, Boolean doNotCleanupOnUpdate, Boolean saveProject) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 43
     at Xamarin.ProjectTools.ProjectBuilder.Build(XamarinProject project, Boolean doNotCleanupOnUpdate, String[] parameters, Boolean saveProject, Dictionary`2 environmentVariables) in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\ProjectBuilder.cs:line 67
     at Xamarin.Android.Build.Tests.WearTests.ResolveLibraryImportsWithReadonlyFiles() in C:\Users\Peter\source\xamarin-android\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\WearTests.cs:line 28

Rather than copying the version of the MSBuild assemblies used to build
our test projects to the output directory, we should be able to use the
NuGet package content directly.  These files should only be used by our
project creation APIs and as a result their version shouldn't matter.
@jonathanpeppers
Copy link
Member

Can we run xamarin-android's CI to see if this breaks anything? Otherwise looks good to me.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Ok, this looks good if the build works out here:

dotnet/android#5891

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers merged commit 683f375 into main Apr 29, 2021
@jonathanpeppers jonathanpeppers deleted the local-win-use-msbuild-nuget branch April 29, 2021 21:36
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.

3 participants