且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动生成的"App_Web ********.cs"临时目录中的文件导致生成错误

更新时间:2022-06-03 01:35:28

这与IIS(本地或其他方式)无关.您所看到的那个长而奇怪的文件名就是编译器在编译时给视图的名称.您所描述的一切都告诉您,您的其中一个视图中存在编译错误.可能是HTML标签不匹配,模型属性调用错误等.

This is not related to IIS, local or otherwise. That long, strange file name you are seeing is the name the compiler gives to a view when it compiles it. What everything you have described is telling you is that you have a compilation error in one of your views. It could be mismatched HTML tags, a bad model property call, etc.

查看您的错误消息,您在/Views/Home/MostRecentMember.cshtml中有一个视图.此外,似乎您确实是在模型声明中缺少名称空间,或者在您尝试发送的模型中声明了错误的名称空间.

Looking at your error message, you have a view in the /Views/Home/MostRecentMember.cshtml. Further, it appears that you are indeed either missing the namespace for your model declaration or declared the wrong namespace for the model that you are trying to send in.

删除文件名奇怪的东西不会像重建时那样做,它会回来,很可能使用不同的名称.

Deleting the strangely named file will do nothing as when you rebuild, it will come back, most likely with a different name.