TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
C# calling an executable problem
Oct 3 2012 9:46 AM
I have a C# 2010 console application that calls a web service where I am having a problem. The line of code that is commented out for the strConsoleAppLocation string field works correctly when I run the application from my workstation. However when the application is deployed the line of code that refers to strConsoleAppLocation path is changed, I get an error on the line of code, " Process1.StartInfo.Arguments = Process_Arguments;".
When the application is deployed, I make certain the executable is located in the directory path:
\\server1\\DEV\\Ftest\\Esample.exe
.
Here is the code I am referring to;
protected void add_to Web_service()
{
String strConsoleAppLocation = "
\\server1\\DEV\\Ftest\\Esample.exe
";
//String strConsoleAppLocation = "C:\\Users\\me\\Documents\\Visual Studio 2010\\Projects\\bin\\Debug\\Esample.exe";";
String strEncryptedValue = "encrypted";
String strWebServiceurl = "https://test/test1/TWebService";
Process Process1 = new Process();
String Process_Arguments = null;
Process1.StartInfo.UseShellExecute = false;
Process1.StartInfo.FileName = strConsoleAppLocation;
Process1_Arguments = strEncryptedValue + " " + strWebServiceurl + " 798 ";
Process1.StartInfo.Arguments = Process_Arguments;
Process1.Start();
}
Due to what I mentioned above, I have the following questions:
1. Can you tell me what to do to resolve this issue for now?
2. When this application goes to production, can you tell me and/or point me to a reference to display the preferred method
of how the Esample.exe executable should be called?
Reply
Answers (
2
)
How to update windows form layout from internet ?
Turn an integer into a month name