本文介绍了CSHTML文件不再编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然在ASP.NET MVC应用程序的工作,我遇到好老的电流源$ C ​​$ c是内置App_Web_blahblah.dll版本不同的当我尝试调试CSHTML文件,无论我做(删除临时ASP.NET文件,PDBS,清理和重建,等等)。

While working on an ASP.NET MVC application, I meet the good old "The current source code is different from the version built into App_Web_blahblah.dll" when I'm trying to debug a CSHTML file, whatever I do (deleting Temporary ASP.NET files, PDBs, cleaning and rebuilding, etc).

什么是更令人不安的是,相关CSHTML页面不再编译。我的意思是,应用程序不断显示一个旧版本的页面,即使这个已经改变了。

What's more disturbing is that the related CSHTML page isn't compiled anymore. I mean, the application keeps showing an old version of the page, even if this one has changed.

还有这个页面上没有错误(同一来源$ C ​​$ C工程确定另一台机器上)。即使有,我会得到一个YSOD,仅此而已。

There's no errors on this page (the same source code works OK on another machine). Even if there were, I would get a YSOD and that's it.

更重要的是,它使显示数据,是不是在源$ C ​​$ C了,即使我以前到处打扫临时文件和DLL,所以我不能在此页面上工作了。

More importantly, it keeps displaying data that isn't in the source code anymore, and even if I cleaned the temporary files and DLLs everywhere before, so I can't work on this page anymore.

我检查<一href=\"http://stackoverflow.com/questions/2468852/the-breakpoint-will-not-currently-be-hit-the-source-$c$c-is-different-from-the\">there和there,但没有答案的问题解决了。

I checked there and there, but none of the answers solved the problem.

所以我的问题很简单:该应用程序在哪里可以找到code,是不是任何地方(据我所知)?有没有我不知道的可以保存的位置编译后的文件的另一个位置?这是怎么回事?

So my question is simple : where can the application find code that isn't anywhere (AFAIK) ? Is there another location that I'm not aware of where compiled files can be stored ? What's happening ?

推荐答案

我的评论帮助,所以我会写一个答案。

My comment helped so I will write an answer.

此错误是引起了另一个目的地增加了项目文件。你修改文件,该文件是不是在正确的文件夹,但旧的仍然存在。应用程序正在运行旧的,因为它不是在看的csproj文件,但只在文​​件恰好有放置在浏览文件夹中。

This error was caused adding to project file from another destination. You were modifying file which wasn't in correct folder, but old one was still there. Application was running the old one, because it isn't looking at csproj file, but only at files there are placed exactly in Views folder.

这篇关于CSHTML文件不再编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:21