Open gcrossland-cosworth opened 6 years ago
399-repoproj.zip contains a VS solution created using the reproduction steps (including the extra bit), plus msbuild's diagnostic output.
@gcrossland-cosworth apologies for the delay.
@rnagpal can you please take a look at this?
I'm getting the same error with a Xamarin forms application. But I just tried of adding the dll as a manual reference than nuget and it worked. I think the issue may be the long path to the dll as it's runtime path is very long
I can also confirm this does seem to be an issue, will try the work around, but was getting the issue on VS for Mac too
Android is compiling okay, but on iOS:
MTOUCH : error MT0009: Error while loading assemblies: /Users/jamesmontemagno/.nuget/packages/microsoft.azure.documentdb.core/1.8.1/runtimes/win/native/DocumentDB.Spatial.Sql.dll
I can confirm that it does exist though
I should mention that I am consuming a .NET Standard 2.0 library that also has the nuget installed.
I remove the NuGet from the iOS project and it still had issues. I had to remove it from the .NET Standard project as well. Then it would build again.
Looks like if we use; https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/ then there aren't any issues
I believe this is a Mono MSBuild bug:
https://bugzilla.xamarin.com/show_bug.cgi?id=57229
Currently Mono's MSBuild is adding win runtimes to the project.assets.json file when it runs a restore.
You should be able to workaround this by changing the runtime identifiers in the iOS project. Adding the following to iOS project, running a restore again, then building, and all is good again.
<RuntimeIdentifiers>mac;mac-x86;mac-x64</RuntimeIdentifiers>
<NuGetRuntimeIdentifier>mac</NuGetRuntimeIdentifier>
Note that you have to put some runtimes in here, since if they are not defined then 'win' will be used by default. Since the NuGet package has no associated runtimes for mac this prevents the 'win' dlls from being used.
@ausfeldt - 1.21.0 of that package worked ... but looks like it has been rolled back (see #443). And 1.21.1 does not work.
Good news is that 1.9.1 of https://www.nuget.org/packages/Microsoft.Azure.DocumentDB.Core/ seems to work.
Bouncing back and forth between the NuGets isn't ideal.
@codemillmatt The package introduced bugs and was unlisted. We will bring back the single NuGet soon when the reported gaps are addressed.
Same problem here (Xamarin.Forms iOS project referencing NetStandard 2.0 class library). Updated Microsoft.Azure.DocumentDB.Core to latest 1.10.0 version, but problem persists:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(786,3): error : Error while loading assemblies: /Users//Library/Caches/Xamarin/mtbs/builds/MyApp.iOS//bin/iPhoneSimulator/Debug/DocumentDB.Spatial.Sql.dll
Same issue, Xamarin.Forms with NetStandard 2.0. If i remove DocumentDB.Core it builds fine.
I've tried multiple versions of DocumentDB.Core and none seem to work for me.
Error while loading assemblies: /Users//Library/Caches/Xamarin/mtbs/builds/App.iOS//bin/iPhoneSimulator/Debug/DocumentDB.Spatial.Sql.dll
i use Visual Studio for Mac. i fixed this bug like this.
`
Trying to build an iOS-targeting Xamarin.Forms project (as created by the cross-platform template wizard) that references (directly or indirectly) the Microsoft.Azure.DocumentDB.Core package (tested with 1.6.0 and 1.7.1) using the new PackageReference package management format in Visual Studio 15.5.0 fails with (for example) ...\Xamarin.iOS.Common.targets(777,3): error : Error while loading assemblies: .../bin/iPhone/Debug/DocumentDB.Spatial.Sql.dll (this message comes from Xamarin's CompileToNative step, which is run on a Mac via Xamarin Agent).
Reproduction: