René's URL Explorer Experiment


Title: Add-Type reference assembly bug · Issue #1616 · PowerShell/PowerShell · GitHub

Open Graph Title: Add-Type reference assembly bug · Issue #1616 · PowerShell/PowerShell

X Title: Add-Type reference assembly bug · Issue #1616 · PowerShell/PowerShell

Description: Steps to reproduce $source = @" using System; namespace Foo { public static class Bar { public static void Test() { Console.BackgroundColor = (Console.ConsoleColor) -1; } } } "@ Add-Type -TypeDefinition $source -Language CSharp -Referenc...

Open Graph Description: Steps to reproduce $source = @" using System; namespace Foo { public static class Bar { public static void Test() { Console.BackgroundColor = (Console.ConsoleColor) -1; } } } "@ Add-Type -TypeDefin...

X Description: Steps to reproduce $source = @" using System; namespace Foo { public static class Bar { public static void Test() { Console.BackgroundColor = (Console.ConsoleColor) -1; } } } "@ Add-Type ...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/1616

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add-Type reference assembly bug","articleBody":"## Steps to reproduce\r\n\r\n``` powershell\r\n$source = @\"\r\nusing System;\r\nnamespace Foo {\r\npublic static class Bar {\r\npublic static void Test() {\r\nConsole.BackgroundColor = (Console.ConsoleColor) -1;\r\n}\r\n}\r\n}\r\n\"@\r\nAdd-Type -TypeDefinition $source -Language CSharp -ReferencedAssemblies System.Console\r\n```\r\n## Expected behavior\r\n\r\nThe type to be added.\r\n## Actual behavior\r\n\r\n```\r\nAdd-Type : (5) : The type 'Console' exists in both 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and\r\n'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'\r\n(4) : public static void Test() {\r\n(5) : >>> System.Console.BackgroundColor = (System.Console.ConsoleColor) -1;\r\n(6) : }\r\nAt line:1 char:1\r\n+ Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssembli ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception\r\n    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand\r\n\r\nAdd-Type : (5) : The type 'Console' exists in both 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and\r\n'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'\r\n(4) : public static void Test() {\r\n(5) : >>> System.Console.BackgroundColor = (System.Console.ConsoleColor) -1;\r\n(6) : }\r\nAt line:1 char:1\r\n+ Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssembli ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception\r\n    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand\r\n\r\nAdd-Type : Cannot add type. Compilation errors occurred.\r\nAt line:1 char:1\r\n+ Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssembli ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException\r\n    + FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand\r\n```\r\n## Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n``` powershell\r\n> $PSVersionTable\r\nName                           Value\r\n----                           -----\r\nPSVersion                      5.1.10032.0\r\nPSEdition                      PowerShellCore\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion                   3.0.0.0\r\nGitCommitId                    v6.0.0-alpha.7\r\nCLRVersion\r\nWSManStackVersion              3.0\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\n\r\n```\r\n\r\n/cc @vors \r\n","author":{"url":"https://github.com/andyleejordan","@type":"Person","name":"andyleejordan"},"datePublished":"2016-08-02T22:21:57Z","url":"https://github.com/PowerShell/PowerShell/issues/1616"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e8f9c626-bbd3-47dd-2296-69ca72a71813
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id84A2:34A55:116154:18A7B1:6AFD5DB6
html-safe-nonceb108e26a67a99ba7845b0abfb41bfeeab942aed1df264c42e58e4f0660472a03
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEEyOjM0QTU1OjExNjE1NDoxOEE3QjE6NkFGRDVEQjYiLCJ2aXNpdG9yX2lkIjoiODcxMzI1NjE2MTU2MzcyOTMzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4d9b6122bbb15557a270efa9119ff323df80d6f6efa7cdbe716c02b75bbc2ab3
hovercard-subject-tagissue:169003128
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/1616/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9f1ed2ba11c0a55e2dccf3228051304076a722bc0bbf8c060b7899e59988e711/PowerShell/PowerShell/issues/1616
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9f1ed2ba11c0a55e2dccf3228051304076a722bc0bbf8c060b7899e59988e711/PowerShell/PowerShell/issues/1616
og:image:altSteps to reproduce $source = @" using System; namespace Foo { public static class Bar { public static void Test() { Console.BackgroundColor = (Console.ConsoleColor) -1; } } } "@ Add-Type -TypeDefin...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandyleejordan
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/1616#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F1616
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F1616
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/1616
Reloadhttps://github.com/PowerShell/PowerShell/issues/1616
Reloadhttps://github.com/PowerShell/PowerShell/issues/1616
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/1616
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/1616
Add-Type reference assembly bughttps://github.com/PowerShell/PowerShell/issues/1616#top
Blockedblocked on something external to this repohttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Blocked%22
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com/andyleejordan
Andy Jordan (andyleejordan)https://github.com/andyleejordan
on Aug 2, 2016https://github.com/PowerShell/PowerShell/issues/1616#issue-169003128
sergei (@vors)https://github.com/vors
Nexthttps://github.com/PowerShell/PowerShell/issues/1616?timeline_page=1
Andy Jordan (andyleejordan)https://github.com/andyleejordan
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
on Aug 2, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-743096628
sergei (vors)https://github.com/vors
on Aug 2, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-743118534
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Aug 4, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-745935259
https://github.com/Jaykul
Joel Bennett (Jaykul)https://github.com/Jaykul
on Aug 16, 2016https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-239997724
There's even a test for that class being therehttps://github.com/PowerShell/PowerShell/blob/3ecac72bafdc281236bc7b4bc621010f52b954bf/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1
sergei (vors)https://github.com/vors
on Sep 8, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-783154428
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
on Sep 16, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-792478962
https://github.com/Jaykul
Joel Bennett (Jaykul)https://github.com/Jaykul
on Sep 19, 2016https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-248144105
Aditya Patwardhan (adityapatwardhan)https://github.com/adityapatwardhan
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
on Sep 20, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-796156491
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
on Sep 28, 2016https://github.com/PowerShell/PowerShell/issues/1616#event-806225352
https://github.com/Iristyle
Ethan J. Brown (Iristyle)https://github.com/Iristyle
on Oct 5, 2016https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-251740496
dotnet/roslyn#13267https://github.com/dotnet/roslyn/issues/13267
https://technet.microsoft.com/en-us/library/hh849914.aspxhttps://technet.microsoft.com/en-us/library/hh849914.aspx
https://github.com/vors
sergei (vors)https://github.com/vors
on Nov 17, 2016https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-261121767
Tomáš Matoušek (@tmat)https://github.com/tmat
dotnet/roslyn#5855https://github.com/dotnet/roslyn/issues/5855
https://github.com/tmat
Tomáš Matoušek (tmat)https://github.com/tmat
on Nov 17, 2016https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-261123480
https://github.com/dotnet/corefx/issues/5540https://github.com/dotnet/corefx/issues/5540
https://github.com/Iristyle
Ethan J. Brown (Iristyle)https://github.com/Iristyle
on Feb 6, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-277834304
https://github.com/dotnet/coreclr/issues/4651https://github.com/dotnet/coreclr/issues/4651
dotnet/coreclr#9269https://github.com/dotnet/coreclr/pull/9269
dotnet/coreclr#9269https://github.com/dotnet/coreclr/pull/9269
sergei (@vors)https://github.com/vors
https://github.com/joeyaiello
Joey Aiello (joeyaiello)https://github.com/joeyaiello
on Feb 7, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-278141599
Jason Shirk (@lzybkr)https://github.com/lzybkr
sergei (@vors)https://github.com/vors
Jason Shirk (@lzybkr)https://github.com/lzybkr
#3095https://github.com/PowerShell/PowerShell/pull/3095
https://github.com/lzybkr
Jason Shirk (lzybkr)https://github.com/lzybkr
on Feb 8, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-278205357
https://github.com/joeyaiello
Joey Aiello (joeyaiello)https://github.com/joeyaiello
on Mar 2, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-283789930
https://github.com/MaximoTrinidad
Maximo Trinidad (MaximoTrinidad)https://github.com/MaximoTrinidad
on Mar 3, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-284027515
https://github.com/andyleejordan
Andy Jordan (andyleejordan)https://github.com/andyleejordan
on Mar 3, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-284033967
Maximo Trinidad (@MaximoTrinidad)https://github.com/MaximoTrinidad
https://github.com/MaximoTrinidad
Maximo Trinidad (MaximoTrinidad)https://github.com/MaximoTrinidad
on Mar 3, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-284040731
Andy Jordan (@andschwa)https://github.com/andschwa
https://github.com/andyleejordan
Andy Jordan (andyleejordan)https://github.com/andyleejordan
on Mar 3, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-284048108
Maximo Trinidad (@MaximoTrinidad)https://github.com/MaximoTrinidad
https://github.com/MaximoTrinidad
Maximo Trinidad (MaximoTrinidad)https://github.com/MaximoTrinidad
on Mar 3, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-284049141
Andy Jordan (@andschwa)https://github.com/andschwa
https://github.com/joeyaiello
Joey Aiello (joeyaiello)https://github.com/joeyaiello
on May 23, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-303513830
#3264https://github.com/PowerShell/PowerShell/issues/3264
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Joey Aiello (joeyaiello)https://github.com/joeyaiello
on May 23, 2017https://github.com/PowerShell/PowerShell/issues/1616#event-1094380479
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
on May 23, 2017https://github.com/PowerShell/PowerShell/issues/1616#event-1094402557
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on May 23, 2017https://github.com/PowerShell/PowerShell/issues/1616#issuecomment-303517803
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 23, 2017https://github.com/PowerShell/PowerShell/issues/1616#event-1094402591
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/1616
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/1616
Blockedblocked on something external to this repohttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Blocked%22
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.