开发者

DEV looks great,on Staging and PROD I am getting a CS1061 error ('ASP.B' does not contain a definition for 'Prop1')

I have web user control A that uses another web user control B. Inside A I have:

<prefixABC:b ... Prop1="value" />

This prop1 is a public property defined on B.ascx:

<script runat="server">
...
public string Prop1 { get; set; }
...
</script>

Note: I know I wasn't supposed to be using code inside ascx file but it's an internal requirement :/

I also have different environments: dev, staging, prod. They are basically the same (not identical, but very similar). The thing is on dev it works fine, but on staging and prod I am getting this error message:

Exception type: HttpParseException Exception message: d:...\A.ascx(6): error CS1061: 'ASP.B' does not contain a definition for 'Prop1' and no extension method 'Prop1' accepting a first argument of type 'ASP.B' could be found (are you missing a using directive or an assemb开发者_如何学运维ly reference?)

I am 100% sure that the code is the same on all environments. Could anyone tell me what might be causing this problem?


I figured it out what the problem was. I didn't have access to the PROD environment so I didn't know what files were there. The thing is there was a version of the control B inside the same folder structure (a couple folders up actually) that wasn't supposed to be there and that was conflicting with the correct one. When I removed it, things started working beautifully.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜