-
Notifications
You must be signed in to change notification settings - Fork 4k
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
KeyNotFoundException thrown when compiling optional generic partial methods (no modifier) #72431
Comments
Unfortunately I'm not able to reproduce this issue. Do you have a smaller sample project where this repros that we could look at? |
@jaredpar unfortunately not. I tried recreating a new project but the issue didn't happen. I was hoping you could find out what causes it from the stack trace. The project is private so if you give me a private channel I can send it over to you. |
@datvm can you file a VS feedback bug? That will give us a channel where we can share private files. Choose "Report a Problem" from this menu in Visual Studio |
Closing as we haven't heard back on this. If you're able to submit a VS Feedback bug or have more insights into what is causing the issue we will re-open. |
@jaredpar Hello, sorry about the long delay. I am just back from a long vacation. I have submitted the feedback and attached the problematic project here: https://developercommunity.visualstudio.com/t/KeyNotFoundException-thrown-when-compili/10630851 |
Thanks for uploading the repro. I've assigned out the VS feedback bug for investigation. |
Version Used: Microsoft (R) Visual C# Compiler version 4.9.0-3.24121.1 (a98c90d)
Steps to Reproduce:
Unfortunately I cannot reproduce it in a new project so I do not know what causes it. I hope you can find out from the stack trace. Originally reported at dotnet/sdk#39033:
I have a class with this declaration:
According to the documentation, I should not need to implement this mehtod. However, if I do not implement it for each platform, I would encounter this issue when building (the exception is from CSC.exe):
VS Error List also goes crazy and list each exception line as an error:
If I run
dotnet build
from the CLI instead of VS, at least I get the detailed info of which causes the problem:By adding an empty implementation to all files (iOS/Windows etc), the error disappears.
Diagnostic Id: N/A
Expected Behavior: The build should be successful as the method is optional. At least it should tell me where the problem is.
Actual Behavior: Exception is thrown by CSC.
The text was updated successfully, but these errors were encountered: