Skip to content
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

Fix for WCFCSTools issue - invalid namedPipe URL throws uncatchable exception in VS. #5604

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

imcarolwang
Copy link
Contributor

@imcarolwang imcarolwang commented Jul 11, 2024

Description:

WCF CS tool invokes dotnet-svcutil-lib, which uses reflection to download metadata from a net.pipe URL. If an exception occurs during this reflection process and it isn't properly caught, Visual Studio may crash.

The fix is wrapping the reflection code's return type and any potential exceptions with TaskCompletionSource<TheType> instance. This approach ensures that exceptions are available to WCF CS tool, preventing VS crash and providing a more user-friendly exception message.

@HongGit
Copy link
Contributor

HongGit commented Jul 12, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imcarolwang
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@HongGit HongGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a testcase for this change?

@imcarolwang
Copy link
Contributor Author

imcarolwang commented Sep 11, 2024

Is it possible to add a testcase for this change?

I found that the unhandled exception from dotnet-svcutil-lib will be output to the process running the command line tool, whether the fix is applied or not, and cmd.exe does not crash. I think to verify the fix, we will need to invoke the code from WCF CS Tool in VS. We will add this test scenario in testing the WCF CS Tool.

@imcarolwang imcarolwang merged commit 3e24c11 into dotnet:main Sep 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants