Hello guys, I just started learning C# (having studied VB.NET for the last 2 years) and I was wondering if you could help me out on this problem I have encountered. All I want is start an application using the Process.Start
method. In VB.NET, this was pretty easy and straightforward as I needed no "imports" of namespaces (not that I care much about that). Anyway, as far as I'm concerned, this is all the stuff that should be imported (as mentioned in the MSDN article of the method):
using System;
using System.Diagnostics;
using System.ComponentModel;
The funny thing is that after importing System.ComponentModel
, it says that ComponentModel
does not exist in the System
namespace and that I am probably missing an assembly reference of some sort (not really sure what this is). That is only the first part of the problem, though. The other part is that this code will neither work
class MyClass
{
static void Main()
{
Process.Start("IExplore.exe"); // I put IE here as an example only!
}
}
, because it says that "The name 'Process' does not exist in the current context". Am I missing something? I would really appreciate it if any of you guys explained to me what is wrong here. Thank you in advance.