admin管理员组文章数量:1122832
I'm working on an ASPX project using .NET Framework in Visual Studio 2022. My pages inherit a base class BasePage, which contains a helper function GetVersionedPath. Here's the relevant setup:
Page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="analitica.aspx.vb" Inherits="VisualIntelligence.analitica" %>
<%@ Register Src="~/Controls/Sidebar.ascx" TagName="Sidebar" TagPrefix="uc" %>
<link href="<%= GetVersionedPath("../assets/styles/dashboard.min.css") %>" rel="stylesheet" />
Code-Behind for the Page:
Public Class analitica
Inherits BasePage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Request.Cookies("jwt_token") Is Nothing Then Response.Redirect("../Login.aspx")
If TokenManager.GetPrincipal(Request.Cookies("jwt_token").Value) Is Nothing Then Response.Redirect("Login.aspx")
End Sub
End Class
Base Page:
Public Class BasePage
Inherits Page
Private Shared _version As String
Protected ReadOnly Property Version As String
Get
#If DEBUG Then
Return Date.Now.ToString("yyyyMMddHHmmss")
#Else
If String.IsNullOrEmpty(_version) Then
_version = ConfigurationManager.AppSettings("AppVersion")
End If
Return _version
#End If
End Get
End Property
Protected Function GetVersionedPath(relativePath As String) As String
Return $"{ResolveUrl(relativePath)}?v={Version}"
End Function
End Class
The application runs without issues, and the GetVersionedPath function works as expected at runtime. However, Visual Studio 2022 displays the following IntelliSense error for the <%= GetVersionedPath(...) %>
usage in the ASPX file:
BC30451: 'GetVersionedPath' is not declared. It may be inaccessible due to its protection level.
My Environment:
- Visual Studio 2022
- .NET Framework 4.7.2
What could be causing IntelliSense to fail in recognizing GetVersionedPath
, even though the application runs fine? How can I resolve this?
本文标签:
版权声明:本文标题:asp.net - Visual Studio IntelliSense Fails to Recognize Method in Base Page for ASPX .NET Framework Project - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309862a1934173.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论