I'm trying to add siri intent to my application.
I've created intent extensions project, than created ios library project (kit project as in a documentation) which has reference to .netstandard project with shared logic (core).
The core project use MvvmCross and when i'm trying to build main application it cause to:
error MT2001: Could not link assemblies. Reason: Error while
processing references of 'Diabetto.iOS.Intents, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null'
With more detailed logs i've known a reason of this error:
Error while processing references of 'Diabetto.iOS.Intents' --->
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly:
'MvvmCross, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null'
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'MvvmCross, Version=6.4.1.0, Culture=neutral,
PublicKeyToken=null'
I've tried to add nuget reference to iOS class library, to iOS intent library (unsuccessful, got error
Failed to add reference. The package 'MvvmCross' tried to add a
framework reference to 'System.Drawing.Common.dll' which was not found
in the GAC
VS 2019 16.3.5, iOS project 13.1
To be clear, my project structure
and link to project
Solved this problem.
Explicit add nuget reference to System.Drawing.Common and MvvmCross.
Problem was in System.Drawing.Common, VS is trying to use GAC version. With nuget reference it use .net standard version.
Related
I have a NetStandard 1.6 library that references an external library (System.Runtime.Loader, fetched from NuGet). If I reference my NetStandard library from a Net Framework 4.7 Windows-application I get a System.IO.FileNotFoundException when running the Net Framework application.
Full exception:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
Now, I know full what the exception message means but I haven't got the foggiest on how to solve it in this situation.
Ideas?
I advise you to right click on the visual studio solution, go to manage nuget packages for the solution and check the versions of the various libraries you have. Any conflicts between the libraries will be present in the 'consolidate' tab. Alternatively, try removing the library reference from the project's reference folder and adding it back.
I want to create a library for ASP.NET Core in VS17 that uses System.Data.SqlClient for accesing database. I picked .NET Core Library Class.
The problem is that I'm getting errors like :
CS0012 The type 'Object' is defined in an assembly that is not >referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, >Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On stackoverflow I found a thread with advice to add NuGet package : Microsoft.NETCore.Portable.Compatibility, but then it just throws following exception :
FileNotFoundException: Could not load file or assembly 'System.Data, >Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I tried getting other library types like .NET Standard or .NET Framework, but I am also getting errors e.g. some types from standard System.Data.SqlClient are unavailable.
Is there a way to create a library for ASP.NET Core that uses SqlClient for accesing database then?
I had a similar problem of your.
Try simply run dotnet restore myProjectName on package manager console or on command prompt.
In this way the packages and SDK's on your project are download and reference problems will go away.
I move a solution from VS2015 to VS2017. I have a WebAPI.dll that has helper functions in it that make API calls using System.Net.Http. My client ASP.NET applications reference this WebAPI.dll so they can simply call a function such as GetProducts().
In VS2015 I never needed my clients to reference System.Net.Http NuGet package to use the WebAPI.dll.
Now I get the following error when calling one of the functions in the dll:
Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
The only resolution is to add the System.Net.Http NuGet package to any Class Library or Web App that references and uses this WebAPI.dll.
Can someone please explain why this is the case?
I am using Xamarin on a Mac and have built up a series of .netstandard1.3 libraries. One of which is referencing a few external packages:
NETStandard.Library
Newtonsoft.Json
System.Linq.Queryable
System.Reactive
System.Security.Principal
When I build the project (library) it builds but with the following warning:
/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->
CSC: warning CS1702: Assuming assembly reference
System.Runtime.Serialization.Primitives, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches assembly
System.Runtime.Serialization.Primitives, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
You may need to supply runtime policy
I'm not directly referencing this specific library anywhere, but even if I were the version and public key token appear to be identical so why the complaint? How do I get rid of this warning and why am I getting it?
Despite having the same assembly identity, there are different implementations of System.Runtime.Serialization.Primitives.dll presumably because of runtime specific behavior / implementation. MSBuild is not sure which to use. You may target your library to multiple runtimes, or distribute it as a NuGet package which shifts the responsibility of picking a target runtime to the library or app consuming your package. You can download the package, change it to a .zip and take a peak inside to see what I mean.
I'm developping in Xamarin PCL a project cross-platform I'm testing on IOS and android with Visual studio 2015 V4.6. I need to include System.ServiceModel In my portable Class to consume WCF Services. I can't Include it with Nuget Packets.
Could not install package 'System.ServiceModel.Primitives 4.3.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I tried to include directly Right clic on References -> path->System.ServiceModel[4.0.0.0] and then add*
I have this error message
' Severity Code Description Project File Line Suppression State
Error Can not resolve reference: /Users/ludovic/Library/Caches/Xamarin/mtbs/builds/DemoHandyLife.iOS/725fe7b4d3cb829a82e1002d425b8f86/bin/iPhoneSimulator/Debug/System.EnterpriseServices.Wrapper.dll DemoHandyLife.iOS C:\Program Files\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 696'
If I add System.ServiceModel[5.0.0.0] I have these Error Message
Error CS0012 The type 'CookieContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
Error CS0012 The type 'CookieContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
I tried to add the system.Net Version=5.0.5.0 automatically but nothing happen.
Can someone Help me? Thanks in advance
Tell me if you need more details.
Thanks in advance for your help.
Hello you can't directly add your WCf service to your Portable class library, I suggest to convert your wcf Service in a wcf rest Service. I let you watch the tutorial
or you can follow this tutorial if you absolutely want wsdl service. you can add it directly in your pcl class with the last xamarin version
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/