有没有办法禁用已从项目中排除的视图的编译检查?
我打开了编译视图,并且刚刚更改了项目的很大一部分,因此一些视图目前不相关。
我右键单击它们并选择从项目中排除
。
但是,这些文件仍会在编译时进行检查并出现错误(因为它们的 ViewModel/模型不再存在)。
模型/ViewModel 本身被排除在项目之外并且不会被检查,但是,这些文件有一天会被包含在内,我不想删除它们。
到目前为止,我找到的唯一解决方案是突出显示视图的全部内容并将其注释掉。
虽然我的解决方案确实有效,但这是一个错误还是我做错了什么......或者甚至有更好的解决方法吗?
I have Compile Views turned on and have just changed a big portion of my project so that a few of the views are not relevant at the moment.
I right clicked on them and chose Exclude from project
.
However, these files are still be checked at compile time and come up in errors (as their ViewModel/model no longer exists).
The model/ViewModel themselves are excluded from the project and are not checked, but, these files will one day be included and I do not want to delete them.
So far, the only solution I have found is to highlight the entire content of the views and comment them out.
Whilst my solution does work, is this a bug or am I doing something wrong... or even, is there a better work around?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这些文件被排除在项目之外,则不应编译它们。
您可能会遇到的是,目标文件仍然是输出目录,正是这些文件生成了错误。
您可以在排除文件之前清理项目,或者直接删除 bin 和 obj 目录以删除所有旧输出。
If the files are excluded from the project then they shouldn't be compiled.
What you might have is that the object files are still the output directory and it's these that are generating the errors.
You could either clean the project before excluding the files or simply delete the
bin
andobj
directories to remove all the old output.