Skip to content

Remote Debug fails for projects that multi target several frameworks (Error NETSDK1129) #36

Closed

Description

@MagicAndre1981

The remote debug fails for projects that multi target several frameworks added in the csproj:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>

</Project>

Trying to debug generates an error message

raspberrydebugger

[raspberry]: INFO: Checking for native Windows OpenSSH client
[raspberry]: INFO: Building: D:\FooApp\FooApp\FooApp.csproj
[raspberry]: INFO: Build succeeded
[raspberry]: INFO: Publishing: D:\FooApp\FooApp\FooApp.csproj
[raspberry]: ERROR: Publish failed: ExitCode=1
Microsoft (R)-Build-Engine, Version 16.10.1+2fd48ab73 für .NET
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
  Wiederherzustellende Projekte werden ermittelt...
  "D:\FooApp\FooApp\FooApp.csproj" wiederhergestellt (in 89 ms).
C:\Program Files\dotnet\sdk\5.0.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets(27,5): error NETSDK1129: Das Ziel für "Publish" wird ohne Angabe eines Zielframeworks nicht unterstützt. Das aktuelle Projekt verwendet mehrere Frameworks als Ziel. Sie müssen das Framework für die veröffentlichte Anwendung angeben. [D:\FooApp\FooApp\FooApp.csproj]

when I only use 1 targetframework, debug works

Activity

  1. MagicAndre1981 commented on Jul 7, 2021

    @MagicAndre1981
    ContributorAuthor

    any update? When I try to debug the extension from source code I only get a ghosted VS2019 window and VS is not responding

  2. MagicAndre1981 commented on Jul 8, 2021

    @MagicAndre1981
    ContributorAuthor

    ok, on a second VM debugging works and I can see in PublishProjectAsync the --framework option is not set.

    So I added a property Framework to ProjectProperties and set it in CopyFrom to value of FriendlyTargetFramework, but this is always the first value from TargetFrameworks and not the value from the debug settings of the project.

  3. MagicAndre1981 commented on Jul 12, 2021

    @MagicAndre1981
    ContributorAuthor

    ok, I fixed it in my local copy. I need to use IActiveDebugFrameworkServices to get information about debugging info (configuration, platform and targetframework).

    vs_settings_debug_6

    vs_settings_debug_7

    And when I pass this retrieved targetframework to dotnet publish command in DebugHelper, the publish and debug works.

    .net core 3.1

    .net 5.0

    But there is an issue. The stable nuget package Microsoft.VisualStudio.ProjectSystem.Managed 2.0.6142705 on nuget.org misses the required Interface IActiveDebugFrameworkServices and I have to use the pre-release feed on azure to get the 16.10 version.

    Now there is the question what to do? Is it ok to use a lot of pre-release packages?

  4. MagicAndre1981 commented on Jul 13, 2021

    @MagicAndre1981
    ContributorAuthor

    any update @jefflill ? Should I create a PR by using a lot of pre-Release nugets from Azure feed? I added a nuget.config wit the feed so build will work.

  5. MagicAndre1981 commented on Jul 20, 2021

    @MagicAndre1981
    ContributorAuthor

    Should I create a PR by using a lot of pre-Release nugets from Azure feed? I added a nuget.config wit the feed so build will work.

    I created now the PR #38 with nuget.config that gets the required packages @jefflill

  6. added a commit that references this issue on Mar 8, 2022
    2b865bb
  7. MagicAndre1981 commented on Dec 19, 2023

    @MagicAndre1981
    ContributorAuthor

    @jefflill are you working again on the extension?

  8. jefflill commented on Dec 19, 2023

    @jefflill
    Collaborator
  9. MagicAndre1981 commented on Dec 19, 2023

    @MagicAndre1981
    ContributorAuthor

    where you able to get the 2022 versions of my added libs? The user who forked it and added VS2022 support reverted my PR because we was not able to get the prerelease libs from private nuget feeds. I haven't checked if those feeds are still valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions