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

Problem with API developed in Visual Studio 2022 Net Core 6 with Docker compatibility: Works in Debug but fails in Release #393

Open
rlivon opened this issue Jul 7, 2023 · 2 comments

Comments

@rlivon
Copy link

rlivon commented Jul 7, 2023

I developed an API in Visual Studio 2022 for Net Core 6 with Docker compatibility: And it has problems creating a session and connecting to an MSQL 2019 engine if I run it in Release mode. In Debug, everything works perfectly. In this git repository is the code:

https://github.com/rlivon/paas-sisttransfermep-combcra-misc

In this same git repository you can see a video: APINetCore6DockerVS2020.mp4 (in Spanish) of how the API behaves whether it is executed locally, where it works, creates the session and connects to the database, both in Debug mode and in Release mode. You can also see how it runs correctly when triggered with Docker and works fine in Debug mode. However, when doing it in Release mode, you cannot create the session and therefore connect to the MSQL Server engine.

I hope you can help me.

Thank you so much.

@bwateratmsft
Copy link
Contributor

This looks to be about the VS containers extension, not the VSCode one, so I'll transfer the issue over to that repository.

@bwateratmsft bwateratmsft transferred this issue from microsoft/vscode-docker Jul 10, 2023
@dbreshears
Copy link
Member

@rlivon, I suspect this is related to the application settings / configuration in the release configuration that isn't getting set correctly in the container, where it is in debug config. I would recommend getting a terminal from the container tools window into the container and examining the environment settings and comparing how the connection string is getting set between debug and release. This error is typically related to an issue with the connection string or the SQL query. You might also set a breakpoint and turn on first chance exceptions and see if there is additional information in the inner exception details at the point of failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants