User151220215 posted
I have an ASP.NET web application with the following in the aspx page
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script>
var username = "<%=username%>";
</script>
</asp:Content>
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?