我有一个旧的ASP.NET MVC 2项目,我不想升级到MVC 3或MVC 4.我正在开发一台运行Windows 8,Visual Studio 2012和Visual Studio 2013的新机器.当我尝试打开MVC时VS 2012或VS 2013中的2个项目我收到错误:
此项目与当前版本的Visual Studio不兼容
然后在解决方案资源管理器中卸载该项目并显示为灰色.我不想安装另一个Visual Studio副本.如何在新版本的Visual Studio中打开旧的MVC项目?
asp.net-mvc project visual-studio visual-studio-2012 visual-studio-2013
我正在尝试用C#检查服务,我已添加了 System.ServiceProcess.dll
虽然我收到错误:
错误2找不到类型或命名空间名称'ServiceController'(您是否缺少using指令或程序集引用?)D:\ App\Form1.cs 247 13 App
我的代码如下:
private void button13_Click(object sender, EventArgs e)
{
ServiceController sc = new ServiceController("Spooler");
if (sc.Status == ServiceControllerStatus.Running)
{
MessageBox.Show("The service is running.");
}
}
Run Code Online (Sandbox Code Playgroud)
我是否需要"使用"声明?