-
Notifications
You must be signed in to change notification settings - Fork 531
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
[.NET 9.0 Preview 5] Could not load file or assembly NuGet.ProjectModel #9037
Comments
I don't believe this is related to the MAUI UI project. This is dotnet Android SDK tooling. Can you try this in a dotnet Android project ( |
Hi @alexeygritsenko. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@alexeygritsenko I would imagine this works fine with |
@drasticactions, Yes, this is reproduced in android native project (without MAUI), I didn't know that you have dotnet/android repo. Sorry if I posted this topic in the wrong place. In this case, when can I expect Visual Studio support? |
While we should of course address this root issue, also note that we already maintain an |
I had a memory of "how does this work without us shipping But I can't remember where I posted that comment: |
Thanks. As for Square.OkHttp3 library, I know that it already exists in Nuget, I was just interested in testing how it works. In the future, I want to connect libraries that are not available on Nuget in this way, for example mikepenz/FastAdapter |
I suspect it works because the I think we will likely need to |
I wanted to remove |
No worries! It's hard to tell sometimes where issues should go, since these tools are so interlinked and the brands can make it hard to tell what is going on. We just wanna make sure it gets to the right place. It's always better to file an issue somewhere than not file it at all. |
Given that there is very likely a copy of this assembly already loaded in the |
No it's strong named and versioned, so it should work to just ship a copy. |
That should work for .NET framework which supports strong naming, but I suspect it won't work on .NET 6+ which doesn't check strong names.
(https://learn.microsoft.com/en-us/dotnet/standard/assembly/strong-named) For example, let's say we use an API added in On a |
The old problem was that VS had third party extensions (ILSpy/Refactor) which shipped incompatible assembly versions for things like Cecil and NewtonSoft. These would break our tasks, so ILRepack was the only option. Someone needs to test this in VS to make sure we do not hit any clashes. |
I think this PR will work in both VS and An old sample I have is:
ILRepack seems more useful for fixing Mono MSBuild and VS Mac, as Mono didn't do either 1 or 2. If we are concerned, we could try different versions of |
…9098) Fixes: #9037 Attempting to use `@(AndroidMavenLibrary)` in Visual Studio 17.11 P3, which ships .NET 9 P5, like this: <ItemGroup> <AndroidMavenLibrary Include="com.squareup.okhttp3:okhttp" Version="4.9.3" /> </ItemGroup> gives you the error: …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.ProjectModel, Version=6.9.1.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The specified file cannot be found. …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: File name: 'NuGet.ProjectModel, Version=6.9.1.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35' …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: at Xamarin.Android.Tasks.NuGetPackageVersionFinder.Create(String filename, TaskLoggingHelper log) …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: at Xamarin.Android.Tasks.DependencyResolver..ctor(String lockFile, TaskLoggingHelper log) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/JavaDependencyVerification.cs:line 124 …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: at Xamarin.Android.Tasks.JavaDependencyVerification.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/JavaDependencyVerification.cs:line 77 …\Microsoft.Android.Sdk.Windows\34.99.0-preview.5.308\tools\Xamarin.Android.Bindings.JavaDependencyVerification.targets(27,5): error XAJDV7028: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 We need to ship `NuGet.ProjectModel.dll` as well as its dependencies to ensure they are always available to our MSBuild tasks. Note that NuGet does not ship `.pdb` files for these assemblies in their NuGet packages. We will need to exclude these assemblies from `.pdb` checking. This wasn't caught by CI because CI tests use `dotnet build`, *not* Visual Studio, and the `dotnet` install contains `NuGet.ProjectModel` and related dependencies: % find bin/Debug/dotnet -iname NuGet.Project\* bin/Debug/dotnet/sdk/…/Sdks/Microsoft.NET.Sdk/tools/net472/NuGet.ProjectModel.dll bin/Debug/dotnet/sdk/…/NuGet.ProjectModel.dll …
Description
Hi, I'm looking forward to AndroidMavenLibrary, this is what I've been waiting for for a very long time and want to try. After all, for full-fledged development, we always lacked the libraries that developers use in Android Studio.
So I installed:
VS 2022 Preview
.NET 9.0 Preview 5
.NET 9.0 MAUI Workload
And added to Android Binding project
then output error:
Steps to Reproduce
see above
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: