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

Proc.Start Arguments breaking change since 0.6.x upgrade to 0.8.x #15

Open
kachalkov opened this issue Jun 12, 2024 · 9 comments
Open

Comments

@kachalkov
Copy link

hi, we have upgraded to latest version and none of the arguments are being passed in fully due to the code which tries to split by space and add to the list.

we are using bcp process to start and pass args....

@oleg-razvaliaev
Copy link

Yes. the problem exists for arguments passed in as a single string.
Example:
something.exe "argument1 passed as parameters in quoted string" argument2 argument3
Argument2 is not passed into something.exe

@Mpdreamz
Copy link
Contributor

Mpdreamz commented Oct 2, 2024

Sorry to hear!

I tried reproducing this to no avail here: #17

Can you share how you are invoking Proc and the TFM you run under?

For netstandard2.1 we don't do any argument mutations and simply pass the arg string array to: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist?view=net-8.0&viewFallbackFrom=netframework-4.8.1

For netstandard2.0 we don't split by spaces string[] we naively quote any item in that array that has spaces.

Mpdreamz added a commit that referenced this issue Oct 2, 2024
* Attempt to reproduce #15, handling of quoted strings

* move back to just testing net8.0
@kachalkov
Copy link
Author

We tried latest release and had to rollback again as it is still broken for us :-/
Please make proc.net great again :)

@kachalkov
Copy link
Author

Why do you need any string manipulation, that seems like not very good approach do something differently base on version?

@Mpdreamz
Copy link
Contributor

Mpdreamz commented Dec 2, 2024

I'll comment tomorrow on the why @kachalkov :)

Can you share your target framework with me?

@kachalkov
Copy link
Author

4.8

@Mpdreamz
Copy link
Contributor

Mpdreamz commented Dec 3, 2024

Released 0.9.1 which reverses the behavior back.

The problem on Full Framework (<4.8.1) and Net Standard 2.0 is that https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist is not available.

Arguments can only be passed as a single string.

So ["hello world", "good", "day"] using a simple string join would result in 4 arguments to the process which is wrong. So the routine we had naively quoted the first argument.

I might attempt to fix this again in a later version but right now reverted it because I have limited time at the moment and wanted to unblock folks.

Let me know if 0.9.1 works again 🙏

@kachalkov
Copy link
Author

kachalkov commented Dec 4, 2024 via email

@oleg-razvaliaev
Copy link

The changed version works Ok for our use. A little hiccup was to change the method parameters. Thanks!

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

No branches or pull requests

3 participants