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

Mobile head project build issue with nint types #8181

Closed
GebTandon opened this issue Feb 24, 2022 · 3 comments
Closed

Mobile head project build issue with nint types #8181

GebTandon opened this issue Feb 24, 2022 · 3 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@GebTandon
Copy link

Current behavior

I get 2 errors during build of Uno based project.
1> error CS0234: The type or namespace name 'nint' does not exist in the namespace 'System' (are you missing an assembly reference?)
2> error CS7069: Reference to type 'nint' claims it is defined in 'Xamarin.Mac', but it could not be found

Expected behavior

The project should build without any issues.

How to reproduce it (as minimally and precisely as possible)

Core.Universal.zip

Workaround

not known at this moment

Works on UWP/WinUI

No response

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.UI.RemoteControl / Uno.WinUI.RemoteControl

NuGet package version(s)

All projects are on .net6
Uno.Ui & Uno.Ui.RemoteControl version 4.0.13

Affected platforms

macOS

IDE

Visual Studio 2022

IDE version

Community

Relevant plugins

None

Anything else we need to know?

The errors are from single Mobile head project, and it errors on line# 16220 of BindableMegadata.g.cs, here is code at that line
bindableType.AddProperty("ConversationIdentifier", typeof(global::System.nint), GetConversationIdentifier);

I'm able to build all other head projects in the solution attached.

Microsoft has already announced breaking change in .net 6 for nint types, wanted to know what is fix for this issue

Here are outputs of various commands from my machine:
C:\WINDOWS\system32>dotnet --list-sdks

_> 3.1.416 [C:\Program Files\dotnet\sdk]

5.0.405 [C:\Program Files\dotnet\sdk]
6.0.200 [C:\Program Files\dotnet\sdk]_

C:\WINDOWS\system32>dotnet workload list

_>

This command lists only workloads that were installed via dotnet workload install in this version of the SDK and not those that were installed via Visual Studio.

Installed Workload Ids

android
ios
maccatalyst
macos
maui
tvos
wasm-tools

Use dotnet workload search to find additional workloads to install._

@GebTandon GebTandon added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 24, 2022
@jeromelaban
Copy link
Member

Thanks for the report. This is fixed in the latest 4.2-dev experimental builds, compatible with VS 2022 17.2 Preview 1.

@GebTandon
Copy link
Author

Thank you Jerome for quick response.
What do I need to change in current repo, instead of re-creating it?

Geb

@jeromelaban
Copy link
Member

A nuget update will be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants