Frage

Lately I've been editing isolated .aspx and their associated code-behind files. Since the code-behind language is VB, Visual Studio does not give me intellisense until I open both files. Even then, Visual Studio assumes that I am using .NET Framework 2.0. I know that these files run in .NET 4.0 environment and I would like for Visual Studio to stop telling me that string.IsNullOrWhiteSpace is not a member of class string.

Is there any setting I can change to force Visual Studio to run intellisense at a higher framework level for the files I have open?

Is this a case where you just simply have to have a solution file?

War es hilfreich?

Lösung

One workaround you could try is to drop a web.config in the same directory and set the target framework.

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
</configuration>

When VS opens an ASPX file outside any projects (called a miscellaneous file), I believe it looks for a web.config file in the same directory, or else assumes 2.0.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top