Comments (8)
Yeah this is odd but use a space instead of a : with the offending switch.
-d
On Feb 1, 2012, at 8:52 AM, [email protected] wrote:
I have a command line of the following form:
"c:\Some Path With Spaces\dk.exe" execute /environment:DevFit /settings:"c:\Some Path With Spaces\settings" --silent
When I execute, I get the following error:
System.InvalidOperationException: Sequence contains more than one element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source) at dropkick.Engine.DeploymentCommandLineParser.ExtractCommandToRun(IEnumerable
1 commandLineElements)
at dropkick.Engine.DeploymentCommandLineParser.Set(DeploymentArguments arguments, IEnumerable`1 commandLineElements)
at dropkick.Engine.DeploymentCommandLineParser.Parse(String commandline)
at dropkick.Engine.Runner.Deploy(String commandLine)This is a bug with the Magnum.CommandLineParser.MonadicCommandLineParser and underlying classes. I have issued a pull request (#6) in the phatboyg/Magnum project to fix the issue. Once that project is patched, dropkick will need to take in the new Magnum.dll.
Reply to this email directly or view it on GitHub:
#34
from dropkick.
I did figure that out for the switched arguments (Definitions in Magnum speak), but the exception above is actually from the full path to dk.exe (Arguments in Magnum speak). The workarounds of removing the spaces in my path or setting my working directory closer to dk.exe were more expensive than me just fixing it in Magnum.
Note that I also fixed the Definition switch to allow /switch:"some path with spaces".
from dropkick.
that's what I get trying to respond at a stop light.
I will ping chris on the fix and see where that goes. thanks.
-d
On Wed, Feb 1, 2012 at 10:14 AM, rossbeehler <
[email protected]
wrote:
I did figure that out for the switched arguments (Definitions in Magnum
speak), but the exception above is actually from the full path to dk.exe
(Arguments in Magnum speak). The workarounds of removing the spaces in my
path or setting my working directory closer to dk.exe were more expensive
than me just fixing it in Magnum.Note that I also fixed the Definition switch to allow /switch:"some path
with spaces".
Reply to this email directly or view it on GitHub:
#34 (comment)
from dropkick.
After fixing this in Magnum, I found out that I was wrong in my assumption. It doesn't pass the path to dk.exe into the parser. What's happening is that the double quotes are getting removed from the value in /switch:"value", and that is done by .NET.
However, when I change it to have a space between the switch and value like:
/switch "value"
.NET still removes the double quotes, and thus those double quotes don't get into Magnum, and we're back to square 1.
Is there another workaround I'm missing?
from dropkick.
I made a fix in dk.exe to add double quotes back to the .NET parsed arguments so that Magnum can properly see the double quotes. This was added to pull request #31.
from dropkick.
I was thinking about this some more and realized that the logic to add double quotes back to the command line arguments should probably exist in Magnum and no dk.exe since System.Environment.CommandLine is globaly available . Here would be the pseudo-code in MonadicCommandLineParser:
- foreach quotedSubstring in System.Environment.CommandLine
- if magnumCommandLine contains quotedSubstring without double quotes around it
- re-surround quotedSubstring with double quotes in magnumCommandLine
- if magnumCommandLine contains quotedSubstring without double quotes around it
Let me know if that's the direction we should go, and I'll make the change in that project.
from dropkick.
Hi @rossbeehler, where did you end up with this? I'm running into the same issue, my settings file path has spaces in it and it's blowing up the MonadicCommandLineParser. Was there a resolution or workaround for this?
Thanks
from dropkick.
@mmooney I believe this should have been fixed with pull request #31 according to my above comment, but then I also patched it in Magnum: phatboyg/Magnum@7a170f1.
from dropkick.
Related Issues (20)
- BUG: Windows Service install needs to pretend it is local for the install path. HOT 1
- BUG: Web Virtual Directory stuff needs to use a local path. HOT 1
- Enhancement: Extract zip files
- Enhancement: Download a file from a URL
- Enhancement: Integrate with TeamCity to get artifacts HOT 6
- Enhancement: Be able to set an existing web application into offline mode prior to copying HOT 1
- BUG: Security API doesn't always set the FULL access rule correctly
- Bug: Remote Execution Task errors while retrieving remote log file HOT 1
- Enhancement: Overwrite ReadOnly Files HOT 2
- Notify the user, if a role has no corresponding path in .ServerMaps HOT 2
- Bug: Loading deployment spec from a remote location causes error HOT 1
- CopyFile task swallows file not found message
- BUG: Can't set the PathForWebsite value HOT 3
- Process cannot access the file because it is used by another process HOT 12
- Access currently executing role HOT 7
- RemoteCommandLine Execution Idea to make smarter
- Project is dead? HOT 1
- Question: Assembly.LoadFrom in finder HOT 3
- Deployment settings: JSON List gets match to an empty List at runtime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropkick.