I am trying to invoke aspnet_regiis from c# code. I cannot find the path. Some say it should be in C:\Program Files\Microsoft.NET\Framework\... directory. But on my PC it is located in C:\Program Files\Microsoft Visual Studio 9.0\VC. I do not want to hard
code the path to the aspnet_regiis location on the host. Instead I want to programmatically determine the path. Is there a way I can invoke registry or some environment variable to get the path to aspnet_regiis.
Also once path is obtained, I want to export my security key container by invoking the following command. Can someone please look at this and tell me how to get this done?
// Get the path_to_aspnet_regiis- I don't know how to do this.
string args = " -pa " + KeyContainerName + " NT AUTHORITY\\NETWORK SERVICE";
ProcessStartInfo psi = new ProcessStartInfo(path_to_aspnet_regiis)
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
System.Diagnostics.Process process = new System.Diagnostics.Process();
psi.Arguments = args;
process.StartInfo = psi;
View Complete Post