Opening external application(visual studio) or running external application from Dynamics Ax


Below is the job that can open visual studio from the x++ code. Through the same type of code any executable can be run through dynamics Ax.
static voidVisualStudioOpeneingJob(Args _args){System.Diagnostics.Process visualStudioProcess;//This process will start visual studio processSystem.Diagnostics.ProcessStartInfo visualStudioProcessStartInfo; //This process will contain the process argumentsstr visualStudioProcessArguments; // The variable that will be used to provide argument to the process
str visualStudioInstallDirValue;
str projectFullPath = //mentiond your project name here fully qualified path e.g @’C:\VisualStudioProjects\Name.csproj’;
visualStudioProcess = new System.Diagnostics.Process();
visualStudioprocessStartInfo = visualStudioProcess.get_StartInfo();
visualStudioProcessArguments = ‘\”‘ + projectFullPath + ‘\”‘; //+ ‘ /Command \” Edit.Goto 110\”‘ //You can also provide command lines commands here
visualStudioInstallDirValue = @’C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv’;
visualStudioprocessStartInfo.set_FileName(visualStudioInstallDirValue);
// Setting arguments
visualStudioprocessStartInfo.set_Arguments(visualStudioProcessArguments);
visualStudioProcess.Start();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.