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

[Bug] Server project doesn't build when targeting .NET 9 #1276

Open
nickrandolph opened this issue Mar 6, 2025 · 2 comments
Open

[Bug] Server project doesn't build when targeting .NET 9 #1276

nickrandolph opened this issue Mar 6, 2025 · 2 comments
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@nickrandolph
Copy link
Contributor

Current behavior

Create an app using the unoapp template (.net 9) and enable the Server option
Fails to compile due to swagger not being supported

Expected behavior

Server project should use OpenAPI instead of Swagger

Affected platforms

No response

Template Host

Visual Studio

Host OS

Windows

Template Options

-server

Template Version

Latest stable

Anything else we need to know?

No response

@nickrandolph nickrandolph added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Mar 6, 2025
@jeromelaban
Copy link
Member

I'm not able to repro. Which options did you use and what's the error?

@DevTKSS
Copy link
Contributor

DevTKSS commented Mar 8, 2025

@nickrandolph did one my own before seeing this issue and would like to provide the exception details I am getting and the project as repro

Versions:
templates version 5.6.45
uno.sdk 5.6.45
Visual Studio 2022 Community 17.13.2
asp.net workloads and the others from the getting started guide are fully installed

Image

console information I am getting more concrete is at the File DebugHandler ln.17 (default contents are used as visible in repro)
and in case the API is called later in the app, this is not happening at Build time than at runtime, target at this exception is desktop

System.Net.Http.HttpRequestException
  HResult=0x80004005
  Nachricht = Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (localhost:5002)
  Quelle = System.Net.Http
  Stapelüberwachung:
   bei System.Net.Http.HttpConnectionPool.<ConnectToTcpHostAsync>d__52.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.HttpConnectionPool.<ConnectAsync>d__51.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.HttpConnectionPool.<CreateHttp11ConnectionAsync>d__80.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.HttpConnectionPool.<InjectNewHttp11ConnectionAsync>d__79.MoveNext()
   bei System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.<WaitWithCancellationAsync>d__1.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.HttpConnectionWaiter`1.<WaitForConnectionWithTelemetryAsync>d__6.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.HttpConnectionPool.<SendWithVersionDetectionAndRetryAsync>d__50.MoveNext()
   bei System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   bei System.Net.Http.RedirectHandler.<SendAsync>d__4.MoveNext()
   bei UnoApp6.Services.Endpoints.DebugHttpHandler.<SendAsync>d__2.MoveNext() in C:\Users\TKSSonja\source\repos\UnoApp6\UnoApp6\Services\Endpoints\DebugHandler.cs: Zeile17
   bei Uno.Extensions.Http.DiagnosticHandler.<SendAsync>d__2.MoveNext()
   bei Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<<SendCoreAsync>g__Core|5_0>d.MoveNext()
   bei Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<<SendCoreAsync>g__Core|5_0>d.MoveNext()
   bei System.Net.Http.HttpClient.<<SendAsync>g__Core|83_0>d.MoveNext()

  Diese Ausnahme wurde ursprünglich von dieser Aufrufliste ausgelöst:
    [Externer Code]

Innere Ausnahme 1:
SocketException: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.

to be noticed: it is searching for port 5002!

so now switched the target to wasm, the console is giving me this information:

Verbose logs are written to:
C:\Users\TKSSonja\AppData\Local\Temp\visualstudio-js-debugger.txt
Setting DOTNET_MODIFIABLE_ASSEMBLIES=debug
Setting UNO_BOOTSTRAP_MONO_RUNTIME_MODE=Interpreter
Setting UNO_BOOTSTRAP_MONO_PROFILED_AOT=False
Setting UNO_BOOTSTRAP_LINKER_ENABLED=False
Setting UNO_BOOTSTRAP_DEBUGGER_ENABLED=True
Setting UNO_BOOTSTRAP_MONO_RUNTIME_CONFIGURATION=Release
Setting UNO_BOOTSTRAP_MONO_RUNTIME_FEATURES=
Setting UNO_BOOTSTRAP_APP_BASE=package_f8f756ced65ffb1636ebfd463dc85acfcf9fc522
Setting UNO_BOOTSTRAP_WEBAPP_BASE_PATH=/
�[0m�[48;5;127m�[38;5;231mdotnet�[0m�[1m Loaded 50.53 MB resources�[0m
This application was built with linking (tree shaking) disabled. 
Published applications will be significantly smaller if you install wasm-tools workload. 
See also https://aka.ms/dotnet-wasm-features�[0m
Loaded 50.53 MB resources from network
Debugging hotkey: Shift+Alt+D (when application has focus)
Registering service worker for /
IDBFS is not enabled in the project configuration, persistence is disabled. See https://aka.platform.uno/wasm-idbfs for more details
IDBFS is not enabled in the project configuration, persistence is disabled. See https://aka.platform.uno/wasm-idbfs for more details
IDBFS is not enabled in the project configuration, persistence is disabled. See https://aka.platform.uno/wasm-idbfs for more details
Service Worker Registered
MONO_WASM: WebSocket error
MONO_WASM: WebSocket error

but, the app build and runned now on localhost:5000 but switching the 5002 to 5000 seems to not help solving either, tryed it.

https://github.com/user-attachments/assets/f1a8f858-81ab-4d74-a245-e90a2421bad6
repro of mine:
UnoApp6_wasm1276.zip

hoping this helps?

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

No branches or pull requests

3 participants