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

Solution will not build VS 2022 #1770

Closed
roblatour opened this issue Jun 21, 2023 · 13 comments
Closed

Solution will not build VS 2022 #1770

roblatour opened this issue Jun 21, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@roblatour
Copy link

Verification

Describe the bug

github solution fails to build

Which component is your bug related to?

see below

To Reproduce

download library, try to build solution with Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.6.4.
Build fails: with 42 errors

Expected behavior

build should work

Screenshots

Additional context / logging

Severity Code Description Project File Line Suppression State
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocket' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 29 Active
Error CS1069 The type name 'StreamSocket' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 29 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocket' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 39 Active
Error CS1069 The type name 'StreamSocket' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 39 Active
Error CS0731 The type forwarder for type 'Windows.Security.Cryptography.Certificates.ChainValidationResult' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 52 Active
Error CS1069 The type name 'ChainValidationResult' could not be found in the namespace 'Windows.Security.Cryptography.Certificates'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 52 Active
Error CS0731 The type forwarder for type 'Windows.Security.Cryptography.Certificates.Certificate' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 127 Active
Error CS1069 The type name 'Certificate' could not be found in the namespace 'Windows.Security.Cryptography.Certificates'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 127 Active
Error CS0731 The type forwarder for type 'Windows.Security.Cryptography.Certificates.ChainValidationResult' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 142 Active
Error CS1069 The type name 'ChainValidationResult' could not be found in the namespace 'Windows.Security.Cryptography.Certificates'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 142 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocketListener' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 24 Active
Error CS1069 The type name 'StreamSocketListener' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 24 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocketListener' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 73 Active
Error CS1069 The type name 'StreamSocketListener' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 73 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocketListenerConnectionReceivedEventArgs' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 73 Active
Error CS1069 The type name 'StreamSocketListenerConnectionReceivedEventArgs' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 73 Active
Error CS0103 The name 'SocketProtectionLevel' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 46 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocket' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 64 Active
Error CS1069 The type name 'StreamSocket' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 64 Active
Error CS0731 The type forwarder for type 'Windows.Networking.HostName' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 71 Active
Error CS1069 The type name 'HostName' could not be found in the namespace 'Windows.Networking'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 71 Active
Error CS0103 The name 'SocketProtectionLevel' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 82 Active
Error CS0103 The name 'SocketProtectionLevel' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 85 Active
Error CS0103 The name 'SocketProtectionLevel' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 89 Active
Error CS0731 The type forwarder for type 'Windows.Networking.HostName' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 92 Active
Error CS1069 The type name 'HostName' could not be found in the namespace 'Windows.Networking'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 92 Active
Error CS0731 The type forwarder for type 'Windows.Security.Cryptography.Certificates.Certificate' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 139 Active
Error CS1069 The type name 'Certificate' could not be found in the namespace 'Windows.Security.Cryptography.Certificates'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 139 Active
Error CS0731 The type forwarder for type 'Windows.Storage.Streams.IBuffer' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 139 Active
Error CS0731 The type forwarder for type 'Windows.Security.Cryptography.Certificates.ChainValidationResult' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 149 Active
Error CS1069 The type name 'ChainValidationResult' could not be found in the namespace 'Windows.Security.Cryptography.Certificates'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 149 Active
Error CS0103 The name 'ChainValidationResult' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 153 Active
Error CS0103 The name 'ChainValidationResult' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 155 Active
Error CS0103 The name 'ChainValidationResult' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 160 Active
Error CS0103 The name 'ChainValidationResult' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpChannel.Uwp.cs 165 Active
Error CS0731 The type forwarder for type 'Windows.Networking.Sockets.StreamSocketListener' in assembly 'Windows' causes a cycle MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 40 Active
Error CS1069 The type name 'StreamSocketListener' could not be found in the namespace 'Windows.Networking.Sockets'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 40 Active
Error CS0103 The name 'SocketQualityOfService' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 45 Active
Error CS0103 The name 'SocketProtectionLevel' does not exist in the current context MQTTnet (uap10.0) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\Implementations\MqttTcpServerAdapter.Uwp.cs 48 Active
Error CS0006 Metadata file 'C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\bin\Debug\uap10.0\MQTTnet.dll' could not be found MQTTnet.Extensions.ManagedClient (netstandard1.3) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet.Extensions.ManagedClient\CSC 1 Active
Error CS0006 Metadata file 'C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\bin\Debug\uap10.0\MQTTnet.dll' could not be found MQTTnet.Extensions.Rpc (netstandard1.3) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet.Extensions.Rpc\CSC 1 Active
Error CS0006 Metadata file 'C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet\bin\Debug\uap10.0\MQTTnet.dll' could not be found MQTTnet.Extensions.WebSocket4Net (netstandard1.3) C:\Users\Rob Latour\Desktop\New folder\MQTTnet-master\MQTTnet-master\Source\MQTTnet.Extensions.WebSocket4Net\CSC 1 Active

@roblatour roblatour added the bug Something isn't working label Jun 21, 2023
@roblatour roblatour changed the title Solution will not build VS 2021 Solution will not build VS 2022 Jun 21, 2023
@chkr1011
Copy link
Collaborator

Please see https://github.com/dotnet/MQTTnet/wiki/Build for required components which must be installed in order to build this project. The CI build server also uses Studio 2022 and works perfectly.

@logicaloud
Copy link
Contributor

I ran into the same problem on a machine that had the Windows 11 SDK selected for the "Universal Windows Platform development" workload within the Visual Studio installer. Another machine with "Windows 10 SDK 10.0.19041" builds fine. I suspect that this may be the problem.

@roblatour, could you check your selected Windows SDK and does potentially changing the Windows SDK option to Windows 10 work for you?

@roblatour
Copy link
Author

@logicaloud Thank you, I had missed the build requirement noted in https://github.com/dotnet/MQTTnet/wiki/Build as posted by @chrik1011 - I installed Universal Windows Platform development (Version 10.0.18362.0) via "Visual Studio Installer" and then the build worked fine. Thanks again!

@logicaloud
Copy link
Contributor

Thank you. In case someone else comes across this: The particular machine I had problems with had a clean install of Windows 11 and Visual Studio 2022. Workloads included C++ and the "Windows 11 SDK" was preselected for the "Universal Windows Platform development".

The error that I was getting when compiling MQTTnet was "type forwarder ... causes a cycle in windowsruntime" or similar. I have now changed the "Windows SDK" option to use "Windows 10 SDK (10.0.18362.0)" and the build works. For this machine, only that specific SDK version worked, not, for example "Windows 10 SDK (10.0.19041.0)" which worked on a different machine.

I'm note sure if playing around with the Visual Studio installer simply installed something "in the right order" or repaired something or whether there is indeed some specific dependency on the Windows SDK.

@ridomin
Copy link
Contributor

ridomin commented Sep 23, 2023

I ran into the same issue

@chkr1011 is it worth it to keep support for UWP these days?

Wondering if the next major release (5.x) could drop support for old frameworks and target just LTS dotnet versions (4.8 for NETFX and 8.0 for dotnet)

@chkr1011
Copy link
Collaborator

We already tried to remove support for UWP but since MQTT is used on real hardware via Windows IoT Core we still need to support very old targets. It is also a goal of this project to cover as most targets as possible. There are also requests to port this library to .net 3.5 and even 2.0...

@rido-min
Copy link
Member

from https://learn.microsoft.com/en-us/lifecycle/products/windows-10-iot-core

windows iot core is out of support, wondering what's the motivation to support EOL targets.

@chkr1011
Copy link
Collaborator

There is still hardware which runs worldwide based on Windows IoT core and even .NET 4.5.2. This is common for hardware. It often runs very long with software which is out of support. The XBOX also still supports running UWP apps. So I guess we need to support it for a while.

But we may consider moving support for UWP to a different library.

@rido-min
Copy link
Member

users running outdated frameworks (NETFX, NET3, etc..) can always use the existing versions, but new versions going forward could target only supported platforms.

But we may consider moving support for UWP to a different library.

How can we (Microsoft) help with this?

@chkr1011
Copy link
Collaborator

chkr1011 commented Nov 5, 2023

users running outdated frameworks (NETFX, NET3, etc..) can always use the existing versions, but new versions going forward could target only supported platforms.

But we may consider moving support for UWP to a different library.

How can we (Microsoft) help with this?

From the technical perspective it is quite easy. We could also fork this project and port bugfixes whenever needed but this requires some effort and will slow down development of the other stuff.

For starters I would like to create a PR which removes the support for UWP. This may be implemented in the next update (4.4.x). Then we will see how the users respond to that.

What do you think about this strategy? Do you have another idea how to deal with that (apart from just remove all support for older frameworks)?

@rido-min
Copy link
Member

rido-min commented Nov 9, 2023

The strategy sounds good, I was thinking along the same lines.

To provide more insights, I'd like to know more about the other stuff. Beyond bug fixes, is there a backlog or roadmap for next minor and major releases?

Removing UWP will simplify the multi-target, and with .NET8 coming in a few weeks, I'd say the target frameworks could be reduced to: netstandard2.0, .NET6, .NET7 and .NET8.. I'm guessing that the bits produced from a PR/branch can be pushed as previews to MyGet.

Would you like to follow this conversation in a new Discussion or Issue ?

@chkr1011
Copy link
Collaborator

Please create a separate ticket (Issue). Then we can discuss the plan there and involve more people and making this topic more visible.

@rido-min
Copy link
Member

Please create a separate ticket (Issue). Then we can discuss the plan there and involve more people and making this topic more visible.

#1923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants