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

[dotnet] Unit test projects don't work #13319

Open
slluis opened this issue Nov 9, 2021 · 4 comments
Open

[dotnet] Unit test projects don't work #13319

slluis opened this issue Nov 9, 2021 · 4 comments
Labels
dotnet An issue or pull request related to .NET (6) feature A feature to be implemented
Milestone

Comments

@slluis
Copy link

slluis commented Nov 9, 2021

Steps to Reproduce

  1. Build the attached sample
  2. On a terminal, cd to the project directory and run "dotnet test"

Expected Behavior

Test project should run fine

Actual Behavior

Execution fails with "System.DllNotFoundException : Could not find the runtime library libxammac.dylib"

Environment

Visual Studio Community 2022 for Mac Preview
Version 17.0 Preview (17.0 build 5499)
Installation UUID: 756b579c-523c-405c-86c8-c16aec2b68a0

Runtime
.NET 6.0.0-rtm.21518.12 (64-bit)
Architecture: X64

Roslyn (Language Service)
4.1.0-1.21511.14+c09d760509f00afadf0fa9b6ee7d0c53b70943ca

NuGet
Versión: 6.0.0.262

.NET SDK
SDK: /usr/local/share/dotnet/sdk/6.0.100-rtm.21521.3/Sdks
Versiones del SDK:
	6.0.100-rtm.21521.3
	5.0.302
	5.0.301
	5.0.203
	5.0.202
	5.0.103
	5.0.101
	5.0.100
	5.0.100-rc.2.20479.15
	5.0.100-rc.1.20452.10
	5.0.100-preview.5.20279.10
	3.1.413
	3.1.411
	3.1.410
	3.1.409
	3.1.408
	3.1.406
	3.1.404
	3.1.403
	3.1.402
	3.1.200
	3.1.101
	3.1.100
	3.1.100-preview3-014645
	3.1.100-preview1-014459
	3.0.100
	3.0.100-rc1-014190
	3.0.100-preview9-014004
	3.0.100-preview8-013656
	3.0.100-preview7-012821
	2.2.203
	2.2.104
	2.1.811
	2.1.810
	2.1.701
	2.1.700
	2.1.603
	2.1.302
	2.1.4
SDK de MSBuild: /usr/local/share/dotnet/sdk/6.0.100-rtm.21521.3/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Versiones de tiempo de ejecución:
	6.0.0-rtm.21518.12
	5.0.8
	5.0.7
	5.0.6
	5.0.5
	5.0.3
	5.0.1
	5.0.0
	5.0.0-rc.2.20475.5
	5.0.0-rc.1.20451.14
	5.0.0-preview.5.20278.1
	3.1.19
	3.1.17
	3.1.16
	3.1.15
	3.1.14
	3.1.12
	3.1.10
	3.1.9
	3.1.8
	3.1.2
	3.1.1
	3.1.0
	3.1.0-preview3.19553.2
	3.1.0-preview1.19506.1
	3.0.3
	3.0.2
	3.0.0
	3.0.0-rc1-19456-20
	3.0.0-preview9-19423-09
	3.0.0-preview7-27912-14
	2.2.7
	2.2.4
	2.2.2
	2.1.23
	2.1.22
	2.1.16
	2.1.15
	2.1.14
	2.1.13
	2.1.12
	2.1.11
	2.1.10
	2.1.2
	2.0.5

.NET 5.0 SDK
SDK: 5.0.302

SDK de .NET Core 3.1
SDK: 3.1.413

Xamarin.Profiler
Versión: 1.6.15.68
Ubicación: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Versión: 11

Apple Developer Tools
Xcode 13.1 (19466)
Build 13A1030d

Xamarin.Mac
Version: 7.11.2.12 (Visual Studio Community)
Hash: 36c9df625
Branch: registrar-never-really-static-on-macos-d16-10-preview2-bumped-mono
Build date: 2021-10-07 14:55:30-0400

Xamarin.iOS
Version: 15.0.0.6 (Visual Studio Community)
Hash: 2771277e0
Branch: xcode13-ios
Build date: 2021-09-23 10:36:08-0400

Xamarin.Android
Versión: 11.3.99.54 (Visual Studio Community)
"Commit": xamarin-android/main/0e5e06f
Android SDK: /Users/lluis/Library/Developer/Xamarin/android-sdk-macosx
	Versiones de Android admitidas:
		4.4    (nivel de API 19)
		4.4.87 (nivel de API 20)
		5.0    (nivel de API 21)
		5.1    (nivel de API 22)
		6.0    (nivel de API 23)
		7.0    (nivel de API 24)
		7.1    (nivel de API 25)
		8.0    (nivel de API 26)
		8.1    (nivel de API 27)

Versión de SDK Tools: 26.1.1
Versión de las herramientas de plataforma del SDK: 30.0.5
Versión de las herramientas de compilación del SDK: 30.0.2

Información de compilación: 
Mono: c633fe9
Java.Interop: xamarin/java.interop/main@a5ed891
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@683f375

Microsoft OpenJDK for Mobile
Java SDK: /Users/lluis/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
El código EPL de Android Designer está disponible EPL:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.1.0.14
Hash: 9c65d8a
Branch: remotes/origin/HEAD
Build date: 2021-10-27 10:15:31 UTC

Android Device Manager

Build Logs

Example Project (If Possible)

NormalTest.zip

@rolfbjarne rolfbjarne added dotnet An issue or pull request related to .NET (6) dotnet-pri1 .NET 6: important for stable release labels Nov 9, 2021
@rolfbjarne rolfbjarne added this to the .NET 6 milestone Nov 9, 2021
@rolfbjarne
Copy link
Member

I can reproduce.

The underlying cause is that we create a self-contained app bundle, and getting that to work with dotnet test seems to be somewhat complicated.

This might be a start: microsoft/vstest#2200 (comment)

but unfortunately that runs into another bug currently (#12572), so that might have to be fixed first.

@slluis
Copy link
Author

slluis commented Nov 9, 2021

That vstest issue is related, but maybe not the same, not sure. In mac app case, the problem is not running vstest-console. It is ok to run it using dotnet. The problem is the host process that runs the tests, which is a different process started by vstest-console. This process is implemented in testhost.dll and started using "dotnet" by vstest-console. If I understand it correctly, what we need is vstest-console to start a testhost mac app that can run the tests.

@rolfbjarne rolfbjarne modified the milestones: .NET 6, .NET 7 Jan 25, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 7, .NET 8 Aug 26, 2022
@rolfbjarne rolfbjarne added feature A feature to be implemented and removed dotnet-pri1 .NET 6: important for stable release labels Aug 26, 2022
@cyanfish
Copy link

cyanfish commented Jan 1, 2023

Any update on this? Should we expect this for .NET 8? I've managed to get some unit test coverage on code that interacts with macOS APIs by cross-compiling with MonoMac, but that's incomplete and not a great solution.

@rolfbjarne
Copy link
Member

@cyanfish we'll try to look into this for .NET 8 (but no guarantees we'll have time to actually fix it).

@rolfbjarne rolfbjarne changed the title Unit test projects don't work when target framework is net6.0-macos [dotnet] Unit test projects don't work Jan 30, 2023
@rolfbjarne rolfbjarne modified the milestones: .NET 8, .NET 9 Sep 6, 2023
@rolfbjarne rolfbjarne modified the milestones: .NET 9, .NET 10 Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet An issue or pull request related to .NET (6) feature A feature to be implemented
Projects
None yet
Development

No branches or pull requests

3 participants