Last post Mar 02, 2018 02:46 AM by Brando ZWZ
Mar 01, 2018 03:20 PM|eeldivad|LINK
I have an ASP.NET web application with the following in the aspx page
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
var username = "<%=username%>";
The code behind sets up the variable username for example:
public string username = "david";
In Visual Studio error list pane, it shows this error "The name 'username' does not exist in the current context"
So basically any page that I use <%=VARIABLE%> then I get this error. But it compiles fine and works as expected. But this error is really annoying when I have other pages with several of these errors. This only happens when I build the project as x64.
It works fine if I change the project to x86, but my other project in same solution must be x64 and referenced by my web app so everything needs to be x64 or it complains. So why is it that Visual Studio complains about this error incorrectly when it compiles
just fine? What can I do to fix this? Is this a bug I need to report to Visual Studio team?
Mar 02, 2018 02:46 AM|Brando ZWZ|LINK
According to your description, I have created a test demo on my side, it works well.
I suggest you could send the feedback with your visual studio version by using visual studio.
My IIS express is 64bit and compile mode is x64.