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

Missing debug profile (compability) with worker projects #562

Open
Herdo opened this issue Apr 23, 2024 · 4 comments
Open

Missing debug profile (compability) with worker projects #562

Herdo opened this issue Apr 23, 2024 · 4 comments
Labels
Area: Visual Studio Issues and stories around the VS integration

Comments

@Herdo
Copy link

Herdo commented Apr 23, 2024

I've tried to enable debugging a worker project using the SDK container build, but failed to do so.
Apparently, only the Web SDK supports SDK container style debugging.

It'd be great if the other SDKs would also support the SDK container style debugging like the Web SDK does.

I tried with this project and launch settings:

Worker.csproj

<Project Sdk="Microsoft.NET.Sdk.Worker">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

  <PropertyGroup>
    <IsPublishable>true</IsPublishable>
    <EnableSdkContainerSupport>true</EnableSdkContainerSupport>
    <EnableSdkContainerDebugging>True</EnableSdkContainerDebugging>
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
    <ContainerRuntimeIdentifier>linux-x64</ContainerRuntimeIdentifier>
    <ContainerRepository>test-worker</ContainerRepository>
    <ContainerImageTag>latest</ContainerImageTag>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
  </ItemGroup>
</Project>

launchSettings.json

{
  "profiles": {
    "Container (.NET SDK)": {
      "commandName": "SdkContainer",
      "launchBrowser": false,
      "environmentVariables": {
        "DOTNET_ENVIRONMENT": "Development"
      }
    }
  },
  "$schema": "http://json.schemastore.org/launchsettings.json"
}

Results in Visual Studio 17.9 giving me this error message:
grafik

When chaning the project SDK to Microsoft.NET.Sdk.Web, debugging works fine.

Publishing is not affected. This works fine. The debug functionality is missing.

@baronfel
Copy link
Member

Interesting catch! @danegsta is this something that should be reported in VS developer community for triage on the VS docker tools side?

@baronfel
Copy link
Member

Broadly speaking in 8.0.100 Worker SDK projects should be able to be debugged in this way, and from 8.0.200 onwards any project with the EnableSdkContainerSupport property set to true should be able to be debugged in this way.

@Herdo
Copy link
Author

Herdo commented Apr 23, 2024

Installed SDK version is 8.0.204.

For me it feels like the Visual Studio tooling is lacking some things, as most of it had to be assembled by hand, taken from the Web SDK. Just reporting here due to the error message.

@baronfel
Copy link
Member

Sorry @Herdo - you're totally right, my comments were intended for the VS Docker tools team as a guideline for how to think about what project types can be containerized in what SDK versions when updating the VS features. No reflection on you or your report at all.

@baronfel baronfel added the Area: Visual Studio Issues and stories around the VS integration label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Visual Studio Issues and stories around the VS integration
Projects
None yet
Development

No branches or pull requests

2 participants