Designer files are not inline correctly confusing intellisense in Visual Studio
Hey.
I have a website project loaded in Visual Studio 2008. The .designer files for all my ascx controls are not nested under the control in the solution explorer, and when I reference something in that control in code, I don't get intellisense.
I checked the csproj xml file and the 'compile' elements look the same as in my other projects where this works 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 have tried playing with the project file using the menu command "Website" and "All files I can think of". Any ideas?
UPDATE
Please note that I am trying to attach files that should already be attached.
a source to share
This is an answer to my previous post. Got MS tech support to level it up. In my .aspx pages, changing one of two places solved the problem for me.
On the line in every .aspx file in your project that launches "<%Page Language"
changes "Codebehind="
to "Codefile="
, and in the property "Inherits="
, if it is configured as project_name .FileName, remove "ProjectName."
.
For example, if you had a project named "TestApp" and a file inside it named "NewFunctionalityTest.aspx", change
Inherits="TestApp.NewFunctionalityTest"
to
Inherits="NewFunctionalityTest"
on the first line.
a source to share
I went over this macro to do exactly what you are looking for. The author even posted a video on how to use it. I've never tried it though, so I can't vouch for this.
a source to share
I don't think nesting is an issue for you because the attached files are just eye candy, but depends on the questions ... Not getting intellisense is actually not a nesting factor, but rather has to do with how the links are attached to your project ... Can you share if this happens every time you create a new project or is it for a specific project ...? Have you tried to compile the project? Does intellisense return after compilation ... Generally, for WAP projects, if for somereason intellisense is not available, it should appear after you compile the project ... Let me know if you still face these problems .. ...
a source to share
I don't know if the OP actually fixed his problem, but something very similar happened to me. Designer.vb files not nested, Intellisense not working, etc. The main difference is that I am not using ascx, I am using direct .aspx pages with .vb codebehinds. It seems that all of the controls located on the aspx page are not showing in VS as announced when I try to manipulate the said controls in code. I am getting a list of errors hundreds of times from code I wrote a few months ago (no problem at the time), most of which say, "The name" object name "is not declared" where "objectname" is a textbox or dropdown menu from linked aspx page. To answer Vishal's questions ...
Can you share, does this happen every time you create a new project or is it for a specific project ...?
This happens with one project. I have several other applications in VS2008 that are not causing problems.
Have you tried to compile the project?
Yes, when I compile it lists all build errors that show up in the ErrorList, breaks and catches the ErrorList.
Does intellisense return after compilation
No.
A little more information about this project: This is a converted VS 2003 project. These problems did not start immediately after the conversion since 2003. The conversion happened a few months ago and since then I have made many changes to the web application. The version with these versions on the test server is currently demonstrating new capabilities for the client. This issue only appeared 3 days ago when I logged in to make a few formatting changes to the aspx page. I never had a chance to make these changes because as soon as I opened the project I got a list of errors. This issue affects every aspx page I have in the project.
a source to share