每次启动ASP.NET Core MVC应用程序时出现IIS错误

时间:2022-09-03 20:24:37

I have a problem with using the new ASP.NET Core MVC. I make an empty project or use a web application template. Every time I save changes to any file in Visual Studio 2015 file browser or every time I launch the app with or without debugging, an IIS error pops up:

我在使用新的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".

“您的应用程序中发生了未处理的异常:目录名称C:\ Users \ COMPUTERNAME = ZENBOOK无效”。

What could this path be? Never changed anything in any settings that could trigger such a thing.

这条路可以是什么?从未在任何可能触发此类事件的设置中更改任何内容。

The rest of the error:

其余的错误:

************** 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)

The site is rendered just fine with any refresh. But this error keeps appearing - on two different machines. It never happens with an MVC 4 project, though... My friend, however, does not have any similar problems with ASP.NET Core MVC.

任何刷新都可以使网站呈现得很好。但是这个错误一直出现在两台不同的机器上。尽管如此,它从未发生在MVC 4项目中......但是,我的朋友与ASP.NET Core MVC没有任何类似的问题。

I feel it may have to do with Environment variables, but I checked, they seem to be fine. Any ideas are appreciated.

我觉得它可能与环境变量有关,但我检查过,它们似乎没问题。任何想法都表示赞赏。

1 个解决方案

#1


0  

Does the "Zenbook" username make sense to you? Is that you?

“Zenbook”用户名对您有意义吗?是你吗?

Also, your stack trace describes a problem when executing Windows Forms code. Is there any reason for you to be using any of that? Check your design as that does not make sense, at least to a person not aware of what your application does.

此外,堆栈跟踪描述了执行Windows窗体代码时的问题。你有什么理由使用其中的任何一个吗?检查您的设计,因为这没有意义,至少对于不了解您的应用程序的人而言。

#1


0  

Does the "Zenbook" username make sense to you? Is that you?

“Zenbook”用户名对您有意义吗?是你吗?

Also, your stack trace describes a problem when executing Windows Forms code. Is there any reason for you to be using any of that? Check your design as that does not make sense, at least to a person not aware of what your application does.

此外,堆栈跟踪描述了执行Windows窗体代码时的问题。你有什么理由使用其中的任何一个吗?检查您的设计,因为这没有意义,至少对于不了解您的应用程序的人而言。