我在使用新的 ASP.NET Core MVC 时遇到问题。我创建一个空项目或使用 Web 应用程序模板。每次我在 Visual Studio 2015 文件浏览器中保存对任何文件的更改时,或者每次我在调试或不调试的情况下启动应用程序时,都会弹出 IIS 错误:
"Unhandled exception has occurred in your application: The directory name C:\Users\COMPUTERNAME=ZENBOOK is invalid".
这条路可能是什么?从未更改任何可能触发此类事件的设置。
错误的其余部分:
************** Exception Text **************
System.ArgumentException: The directory name C:\Users\vouCOMPUTERNAME=ZENBOOK\ is invalid.
at System.IO.FileSystemWatcher.set_Path(String value)
at Microsoft.IisExpress.SysTray.TrayAppHiddenForm.TrayAppHiddenForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
站点在任何刷新下都呈现得很好。但是这个错误不断出现 - 在两台不同的机器上。但是,它永远不会发生在 MVC 4 项目中......然而,我的 friend 在 ASP.NET Core MVC 中没有任何类似的问题。
我感觉可能跟环境变量有关,不过我查了一下,好像没问题。任何想法表示赞赏。
最佳答案
“Zenbook”用户名对您有意义吗?是你吗?
此外,您的堆栈跟踪描述了执行 Windows 窗体代码时出现的问题。您有任何理由使用其中的任何一个吗? 检查你的设计,因为这没有意义,至少对于不知道你的应用程序做什么的人来说是这样。
关于c# - 每次启动 ASP.NET Core MVC 应用程序时出现 IIS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38904262/