Don't crash if you reference a generator built against .NET Framework#48400
Conversation
The compiler added a block to prevent loading generators that are built against the .NET Framework, since we know long term that we'll want them to be runnable on .NET Core. The IDE helper that deals with converting the error code to an IDE diagnostic needs to be updated to support this new error, or otherwise Visual Studio will crash. Fixes dotnet#47845
4db95e4 to
c271c72
Compare
| <comment>{1} is the type that was loaded, {0} is the containing assembly. | ||
| </comment> |
There was a problem hiding this comment.
XML formatting got a bit screwed up here.
There was a problem hiding this comment.
F'ing resource files are the bane of my developer existence. (If only there were a better way 👍 )
1097171 to
b8e7505
Compare
|
Filled #48461 to track improving the generator load coverage on desktop. |
|
Tagging @dotnet/roslyn-compiler and @dotnet/roslyn-ide for reviews, since this is fixing issues on both sides. |
| } | ||
|
|
||
| [Fact] | ||
| // can't load a framework targeting generator, which these are in desktop |
There was a problem hiding this comment.
, which these are in desktop [](start = 53, length = 28)
I didn't really understand this part of the comment. Can it be removed? It seems like the previous statement is sufficient.
There was a problem hiding this comment.
Ah, it just means that when running the desktop version of the test, the generators we reference are also desktop (because they're in the same assembly). I'll clean it up to make it more clear.
tmeschter
left a comment
There was a problem hiding this comment.
You're adding localizable resources after the cut-off for 16.8. You should get approval for a tenet exception before merging this in.
| Get | ||
| Throw ExceptionUtilities.Unreachable | ||
| End Get | ||
| End Property |
There was a problem hiding this comment.
don't love that this is unreachable. can we still have some sort of test for this (so that if we do add SG support for VB, this fires for .net framework as well)?
|
@jasonmalinowski |
The compiler added a block to prevent loading generators that are built against the .NET Framework, since we know long term that we'll want them to be runnable on .NET Core. The IDE helper that deals with converting the error code to an IDE diagnostic needs to be updated to support this new error, or otherwise Visual Studio will crash.
Fixes #47845