Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Designer files not nesting correctly, messing up intellisense in Visual Studio

Greetings.

I've got a web site project loaded into Visual Studio 2008. The .designer files for all of my ascx controls are not nested under the control in solution explorer, and when I reference something in that control in the code behind, I don't get intellisense.

I've checked the csproj xml file, and the 'compile' elements appear to be the same as those in my other projects where this is working correctly. An example looks like this:

<Compile Include="Default.aspx.cs">
  <DependentUpon>Default.aspx</DependentUpon>
  <SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Default.aspx.designer.cs">
  <DependentUpon>Default.aspx</DependentUpon>
</Compile>

I've tried playing with the project file, using the Website\Nest Related Files menu command, and everything else that I can think of. Any ideas?

UPDATE

Note that I'm trying to nest files that should be nested already.

like image 525
JoeB Avatar asked Sep 19 '25 07:09

JoeB


1 Answers

This is a response to my own previous post. Got MS Tech Support to straighten it out. On my .aspx pages changing line one in 2 places solved the issue for me.

In the line in each .aspx file in your project that starts "<%Page Language" change "Codebehind=" to "Codefile=", and in your "Inherits=" property if it's set up as ProjectName.FileName then remove the "ProjectName.".

For example if you had a Project named "TestApp" and a file inside it called "NewFunctionalityTest.aspx" change

Inherits="TestApp.NewFunctionalityTest"

to

Inherits="NewFunctionalityTest"

in the first line.

like image 129
user186371 Avatar answered Sep 22 '25 06:09

user186371