Skip to content
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

error XA2002: Can not resolve reference #4729

Closed
markjerz opened this issue May 26, 2020 · 2 comments
Closed

error XA2002: Can not resolve reference #4729

markjerz opened this issue May 26, 2020 · 2 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.

Comments

@markjerz
Copy link

Steps to Reproduce

  1. Create a Xamarin Forms app in vs2019, targeting Android
  2. Add IPFS.Engine nuget 0.13.0
  3. Build the project

Example.zip

Expected Behavior

Builds

Actual Behavior

Doesn't build. The main errors are as follows but I've attached a diagnostic build log as well.

Build FAILED.
2>
2>"F:\Projects\Example\Example\Example.Android\Example.Android.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
2>(_ResolveAssemblies target) -> 
2>  C:\Users\mark\.nuget\packages\tmds.libc\0.2.0\ref\netstandard2.0\Tmds.LibC.dll : warning XA0107: Ignoring Reference Assembly `C:\Users\mark\.nuget\packages\tmds.libc\0.2.0\ref\netstandard2.0\Tmds.LibC.dll`.
2>
2>
2>"F:\Projects\Example\Example\Example.Android\Example.Android.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
2>(_ResolveAssemblies target) -> 
2>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1660,2): error XA2002: Can not resolve reference: `Tmds.LibC`, referenced by `Makaretu.Dns.Multicast`. Please add a NuGet package or assembly reference for `Tmds.LibC`, or remove the reference to `Makaretu.Dns.Multicast`.
2>
2>    1 Warning(s)
2>    1 Error(s)

This seems related to #3898 but must be slightly different as I should have that fix. It appears that Tmds.LibC is a reference assembly??

This has only started happening since I updated vs2019 to 16.6.

Version Information

Microsoft Visual Studio Community 2019
Version 16.6.0
VisualStudio.16.Release/16.6.0+30114.105
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

ASP.NET and Web Tools 2019 16.6.936.3669
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services 16.1.0.2020603+b3ac44798c16fff5b95dbcfe62dea84aa9a1bd72
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2012 16.6.936.3669
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2019 16.6.936.3669
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.6.936.3669
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.6.936.3669
Azure Functions and Web Jobs Tools

C# Tools 3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper Ultimate 2019.3.4 Build 193.0.20200226.112949
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2020 JetBrains, Inc.

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30212.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.50+g25aae5a24a.R
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Mono Debugging for Visual Studio 16.6.17 (9692114)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62004.28040
Microsoft SQL Server Data Tools

TypeScript Tools 16.0.20417.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.9.1.0 for F# 4.7 16.6.0-beta.20217.4+1c969cac25e2d38d71872efe6c8226029e42bb59
Microsoft Visual F# Tools 10.9.1.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.6.000.1055 (d16-6@2873694)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.6.0.318 (remotes/origin/d16-6@66afc5421)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.6.40 (1f1466f)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.3.1.0 (d16-6/3fe860a)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 165f4b0
Java.Interop: xamarin/java.interop/d16-6@2cab35c
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@49232bc
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-6@bfb66f3

Xamarin.iOS and Xamarin.Mac SDK 13.18.1.31 (b3eedfe)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

MSBuild log attached
msbuildlog.txt

@markjerz markjerz added the Area: App+Library Build Issues when building Library projects or Application projects. label May 26, 2020
@jpobst
Copy link
Contributor

jpobst commented May 27, 2020

I think it is getting ignored because it is in a ref directory instead of a lib directory, which generally means it doesn't contain code, just method stubs. Since we are trying to build a package to run on the device we need something with actual code.

However, it may just be an issue with the NuGet package. I would try copying C:\Users\mark\.nuget\packages\tmds.libc\0.2.0\ref\netstandard2.0\Tmds.LibC.dll into a directory path that does not contain ref, and then add a reference to it in your project. Then try running it again and see if that works.

@jpobst jpobst self-assigned this May 27, 2020
@jpobst jpobst added this to the Under Consideration milestone May 27, 2020
@jpobst jpobst added the need-info Issues that need more information from the author. label May 27, 2020
@jpobst
Copy link
Contributor

jpobst commented Jun 18, 2020

Hopefully this helped get you back on track! Gonna close the issue.

@jpobst jpobst closed this as completed Jun 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

2 participants