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

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

Closed
MagicAndre1981 opened this issue Jun 16, 2021 · 8 comments

Comments

@MagicAndre1981
Copy link
Contributor

MagicAndre1981 commented Jun 16, 2021

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

@MagicAndre1981
Copy link
Contributor Author

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

@MagicAndre1981
Copy link
Contributor Author

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.

@MagicAndre1981
Copy link
Contributor Author

MagicAndre1981 commented Jul 12, 2021

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?

@MagicAndre1981
Copy link
Contributor Author

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.

@MagicAndre1981
Copy link
Contributor Author

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

@MagicAndre1981
Copy link
Contributor Author

@jefflill are you working again on the extension?

@jefflill
Copy link
Collaborator

jefflill commented Dec 19, 2023 via email

@MagicAndre1981
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants