开发者

Visual Studio Setup Project - Retrieving a string from a TextBox Dialog

开发者 https://www.devze.com 2023-03-05 16:50 出处:网络
I am trying to get a value from one of the text box dialogs in Visual Studio Setup Project into a custom action installer class. It seems that it doesn\'t like it when someone enters a string with a s

I am trying to get a value from one of the text box dialogs in Visual Studio Setup Project into a custom action installer class. It seems that it doesn't like it when someone enters a string with a space in it. If a user enters a string with no spaces or quotation marks 开发者_运维百科I can retrieve the string no problem. Otherwise I am getting this error:

Exception occurred while initializing the installation: System.ArgumentException: File Source=localhost;Initial does not exist. If this parameter is used as an installer option, the format must be /key=[value]

Please note that the string is a database connection and "Source=localhost;Initial" would be the second token, if i were to split the entire string on a space. I am clearly missing something here because I cannot imagine that this is an actual limitation of the Visual Studio


You may have to surround your parameter with quotation marks, something like:

/connectionString="[CONNECTIONSTRING]"

That's just a guess, I'm basing it on http://msdn.microsoft.com/en-us/library/2w2fhwzz%28VS.71%29.aspx which suggests that values with spaces in them need to be quoted. The documentation doesn't address your situation exactly, so it's hard to tell.

0

精彩评论

暂无评论...
验证码 换一张
取 消