Skip to content

Target framework "netstandard2.0" does not build with error The name 'Registry' does not exist in the current context #1779

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

Open
3 tasks done
o-l-a-v opened this issue Jan 23, 2025 · 2 comments
Labels
Issue-Bug Something isn't working

Comments

@o-l-a-v
Copy link
Contributor

o-l-a-v commented Jan 23, 2025

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

  • Clone repo
  • & '.\build.ps1' -BuildConfiguration 'Debug' -BuildFramework 'netstandard2.0' -Build -Clean

Results in:

error CS0103: The name 'Registry' does not exist in the current context [D:\Git\personal\PowerShell--PSResourceGet\src\code\Microsoft.PowerShell.PSResourceGet.csproj::TargetFramework=netstandard2.0]

Expected behavior

Should build

Actual behavior

Does not build

Error details

Environment data

Windows 11 24H2 x64
PowerShell v7.4.6

Visuals

Image
@o-l-a-v
Copy link
Contributor Author

o-l-a-v commented Jan 23, 2025

@anamnavi
Copy link
Member

@o-l-a-v thanks for bringing this up. We used to build on netstandard2.0 and had to move to building on net472 to use some assemblies not available to us in netstandard2.0. Our work item here is to clean up the build script so that it's clear we don't build for netstandard2.0.

@anamnavi anamnavi added Issue-Bug Something isn't working and removed Needs-Triage labels Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants