question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Questions] How to know the latest installed dotnet sdk version on a non sdk style project file like .vcxproj

See original GitHub issue

I want to include the nethost.h file in the dotnet distribution path. If I get the latest dotnet sdk version, I can get Microsoft.NETCoreSdk.BundledVersion.props, and the info about navigating to nethost.h is define there.

A more question: Can msbuild get registry data easy? Must I implement a custom ITask?

Thanks.

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
KalleOlaviNiemitalocommented, Feb 2, 2023

For that, you’d use Exec task with ConsoleToMsBuild="true" and an Output child element with TaskParameter="ConsoleOutput". Here’s a sample: https://github.com/dotnet/sdk/blob/a30e465a2e2ea4e2550f319a2dc088daaafe5649/src/Layout/redist/targets/Version.targets#L3-L7

1reaction
KalleOlaviNiemitalocommented, Feb 3, 2023

Visual Studio can do a design-time build that calls some MSBuild targets, and you can make those run extra tasks. I don’t know the details of how design-time builds work in solutions or in C++ projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Questions] How to know the latest installed dotnet sdk ...
I want to include the nethost.h file in the dotnet distribution path. If I get the latest dotnet sdk version, I can get...
Read more >
Check installed .NET versions on Windows, Linux, and ...
Learn how to list which versions of .NET are installed on your computer. This includes the .NET runtime and SDK.
Read more >
Is it possible for a C++ (vcxproj) project to reference a net5. ...
It seems like it should be possible to target net5.0 in a C++ project by now. (I'm using Visual Studio 2022 Preview and...
Read more >
How to change VSCode's TargetFrameworkVersion
Hi, I just installed Unity2018.3 and reinstalled VisualStudio 2017 with frameworkVersion 4.7.1. When I create a script in unity and open it ...
Read more >
VS: DOTNET_SDK: .Net SDK Style Project for C# (#20227)
Net SDK Style Project for C#. Currently CMake generates csproj files that use Microsoft.Common.Props and other properties and targets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found