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.

Using PolySharap with Visual Studio Build Tools 2022

See original GitHub issue

Is it possible to build PolySharp-enabled project using only Visual Studio Build Tools?. I’m on 17.5.4, yet it complains:

packages\PolySharp.1.13.1\build\PolySharp.targets(45,5): Error : The PolySharp source generators have been disabled on the current configuration, as they need Roslyn 4.3 in order to work. PolySharp requires the source generators to run in order to process shaders, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.3 or greater) or .NET SDK version (.NET 6.0.400 SDK or greater).

I suspect it won’t work without full IDE? Using Visual Studio Installer, I cannot find component “C# and Visual Basic Roslyn compilers” (Microsoft.VisualStudio.Component.Roslyn.LanguageServices). Can .NET6/7 somehow be used for language services when targeting .NET Framework? Or is it just for targeting older .NET Core versions? I have installed .NET6/7 on the host too, but the error is still there.

Perhaps if Build Tools are not supported, should be documented as it would help to decide to use PolySharp or no. it happens that my devops agent uses build tools and not the full IDE.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
saucecontrolcommented, Apr 14, 2023

The required MSBuild and Roslyn compiler versions are part of the .NET SDK. As long as you have the current (7.0) SDK version, you can build from command line.

The latest SDK is only supported in the latest Visual Studio version, as listed on the download page, but to be clear, VS is not required at all to use PolySharp.

And yes, it works fine for building .NET Framework projects with the latest .NET SDK. That’s the whole point 😃

0reactions
janis-veinbergscommented, Apr 14, 2023

You must be using <PackageReference> to reference PolySharp (packages.config isn’t supported)

That could be it. I did have .NET 6 and 7 installed. But turns out, project wasn’t using PackageReferences. But I could still build this project with full IDE and “C# and Visual Basic Roslyn compilers” (Microsoft.VisualStudio.Component.Roslyn.LanguageServices enabled (via Visual Studio Installer).

But I cannot test now the case as I moved on by installing full IDE on build server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Tools - Visual Studio - Microsoft
No information is available for this page.
Read more >
Visual Studio Build Tools workload and component IDs
Use Visual Studio workload and component IDs to build classic Windows-based applications.
Read more >
Install Build Tools into a container - Visual Studio
You can install Visual Studio Build Tools into a Windows container to support continuous integration and continuous delivery (CI/CD) workflows.
Read more >
Download Visual Studio Tools - Install Free for Windows, Mac ...
Build Tools for Visual Studio 2022. These Build Tools allow you to build Visual Studio projects from a command-line interface. Supported ...
Read more >
Visual Studio 2022 IDE - Programming Tool for Software ...
With Visual Studio design, code with autocompletions, build, debug, test all-in-one place along with Git management and cloud deployments.
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