Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test we can add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this method is unit-testable, there are too many moving parts here. Can't think of a relatively low-effort automation either, we haven't done any automated integration tests yet...
However I do agree we some form a verification that it is working as intended.
@EatonZ please have a look at #2801. I have created few PS scripts that generate net472 and netcoreapp5.0 app, and then ran manual tests against them to confirm the fix.
You could tweak the "single app" script and then run a series of tests with and without input parameters.
A verification would be something along the lines of:
@hughbe any thoughts on how else we can test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RussKie It seems like we could use the scripts you made there, with 1 tweak: replace
=> System.Windows.Forms.Application.ExecutablePath;
with=> System.Windows.Forms.Application.Restart();
, wrap that in a try/catch and report a failed test if it throws an exception.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We still need to confirm all input arguments are being passed to the new instance.