[英]Resharper can't detect ContentPlaceHolder ID from master page?
I'm very new to ASP.net and webform applications, and I'm inheriting some pretty bad code, but I've got a strange problem that I can't figure out or figure out how to google about it. 我是ASP.net和Webform应用程序的新手,并且继承了一些非常糟糕的代码,但是我遇到了一个奇怪的问题,我无法弄清楚或想出如何用Google搜索它。
In my web site, Resharper is complaining on every page that it couldn't find the corresponding ContentPlaceHolderID from the master page. 在我的网站上,Resharper抱怨每个页面都无法从母版页中找到相应的ContentPlaceHolderID。
Here's a stripped down (for security's sake) version of the ASP.net markup: 这是ASP.net标记的简化版本(出于安全考虑):
<%@ page language="VB" masterpagefile="~/_site.master" autoeventwireup="false" inherits="MyWebPage" theme="Base" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
<h1>SomeText</h1>
<br />
</asp:Content>
And here's the _site.master file (located at the root of the web site): 这是_site.master文件(位于网站的根目录):
<%@ master language="VB" inherits="_CompanyName" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>SomeTitle</title>
</head>
<body>
<form id="form1" runat="server">
....form stuff
</form>
<asp:ContentPlaceHolder runat="server" ID="ContentPlaceHolder"></asp:ContentPlaceHolder>
</body>
</html>
Almost every page displays this error. 几乎每个页面都会显示此错误。 Here's the literal Resharper error message: "Cannot resolve symbol 'ContentPlaceHolder'. 这是字面意义上的Resharper错误消息:“无法解析符号'ContentPlaceHolder'。
Any ideas? 有任何想法吗? Any way I can have Resharper stop displaying this error message? 有什么办法可以让Resharper停止显示此错误消息? It doesn't effect the actual rendering of the page at all (as far as I know), because the page displays correctly according to the original makers. 据我所知,它根本不会影响页面的实际呈现,因为页面是根据原始制造商正确显示的。 I'm just trying to get Resharper to play nicely. 我只是想让Resharper表现出色。
Yes, it can now. 是的,现在可以了。
Install a newer version of ReSharper ( 6.1 or later) and try it again. 安装较新版本的ReSharper( 6.1或更高版本),然后重试。 I also experienced the same problem with earlier versions of ReSharper - but since the version 6.1, the problem just disappeared. 我也遇到了与ReSharper的早期版本相同的问题-但是从6.1版开始,问题就消失了。
Plz tell if it solved your problem, too. 请告诉它是否也解决了您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.