I am trying to run the Mobile project of ASP.NET Zero following their docs for Developing-Step-By-Step-Xamarin.
When I build the project, I get this error:
XA2002: Can not resolve reference: Abp.AutoMapper, referenced by Acme.PhoneBookDemo.Mobile.Shared. Please add a NuGet package or assembly reference for Abp.AutoMapper, or remove the reference to Acme.PhoneBookDemo.Mobile.Shared.
The package Abp.AutoMapper is installed in Acme.PhoneBookDemo.Mobile.Shared
and it is already referenced in the *.csproj:
<PackageReference Include="Abp.AutoMapper" Version="4.2.0" />
Can you please help me?
Solved , the package wasn't installed in *.Droid project but installed in *.Ios and *.Mobile.Shared projects.
Installing it in the *.Droid project resolve the issue.
Related
Trying to update Xamarin.Agora.iOS nuget updates (3.5.1-beta1) get this build time error:
error MT2101: Can't resolve the reference 'System.UIntPtr System.nuint::op_Explicit(System.nuint)', referenced from the method 'System.Int32 DT.Xamarin.Agora.AgoraRtcEngineKit::AdjustUserPlaybackSignalVolume(System.nuint,System.Int32)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxxx'.
Xamarin.forms version is latest: 5.0.0.2244
There's a couple of similar issues opened on the GitHub repo here:
https://github.com/AgoraIO-Community/Agora-RTC-SDK-for-Xamarin/issues/32
If you ping the maintainers of that repo they may be able to help
Using Visual Studio 2019 Version 16.6.0 Preview 2.1 - I have a solution with two projects:
Project A - Has a nuget package dependency Package1
Project B - Has a project reference to Project A
I now also require that Project B include the same nuget package dependency Package 1
When i attempt to install the package I get an error "An item with the same key has already been added".
I have seen a few posts that discuss this, but no definitive solution. For debugging purposes I want to keep Project A as a project reference for Project B. Any idea how I can solve for this?
Project Reference & Nuget Package Reference Conflict - Key with same
name already exists
First, try to remove the Project Reference of Project A in Porject B,then Install Package in Project B and then add the Project Reference of Project A in Project B.Check if it works.
If not, I think there are some different conflicting versions of a nuget package in your Project. See this similar issue. You should remove the duplicate packages. Try these:
1) if you use Packages.config, you should check whether there are two duplicate packages like these:
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" />
Delete the old one and remain the latest one. At the same time, check your xxx.csproj file and delete the duplicate nodes.
2) delete bin,obj folder of Project A and Project B
3) clean local nuget caches and delete the packages folder under your solution(xxxx\Projects\MyProjName\packages).
After that, run update-package -reinstall under Tools-->Nuget Package Manager-->Package Manager Console.
Do both on Project A and Project B.
4) and then to install Package 1 on Project B to test whether the issue persists.
When i build locally it works, but my VSTS hosted 2017 instance build fails with the following message:
[error]apps\Ascend.Identity\AccountController.cs(126,17): Error CS0012: The type 'HttpRequestMessage' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Locally, there is also a yellow triangle in the reference list.
but it still builds
and the reference is there in csproj
and the package is restored from nuget (packages.config)
<package id="System.Net.Http" version="4.3.3" targetFramework="net472" />
In your local, try the steps below:
Delete packages folder in your source directory.
Remove System.Net.Http reference.
Right click References, select Manage Nuget Packages, browser and install package System.Net.Http.
Build your project and check the result. Make sure there is no yellow triangle in the reference list.
Check in the changes and queue a build.
I have a Xamarin iOS project where I have just added SQLCipher to my packages. I now get a build error saying:
iOS/MTOUCH: Error MT0034: Cannot reference 'monotouch.dll' in a
Xamarin.iOS project - it is implicitly referenced by
'SQLite.Net.Platform.SQLCipher.XamarinIOS, Version=4.1.1.0,
Culture=neutral, PublicKeyToken=null'. (MT0034) (myProject.iOS)
I'm not sure how to fix this, I have tried deleting the sqlcipher package and adding again, rebuilding, and restarting Xamarin but no luck. Thanks for any help
In global asax cs file i have this line:
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
which causes this error.
I have tried as suggested on other forums:
Open the Package Manager Console for the project with the error.
Type in Install-Package Microsoft.AspNet.WebApi.WebHost and hit Enter
Rebuild your project and all should be right with the world (or at least right with your project)
The output was:
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 5.2.2 && < 5.3.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 5.2.2)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.4)'.
'Microsoft.AspNet.WebApi.WebHost 5.2.2' already installed.
SM.EORD.Web already has a reference to 'Microsoft.AspNet.WebApi.WebHost 5.2.2'.
and error is still there. What could be wrong?
br, Simon
After hours of investigating i have found out that after I have installed ASP.NET Web API 2.2, the reference path of all dlls was from some old Web API - it didn't take the new ones.
The new dlls has been installed in packages folder, while the old one were in bin folder inside project.
if you want to update your references as well next time try upgrading from the package manager console you can update all or just specify the package name. Update package will upgrade vs installing a new package and you have manually go update your references.
Update-Package
In my case, the problem was that I renamed the Namespace of my project, and I did not know I needed to manually edit the namespaces section of the Views\Web.Config to match my new namespace.