Category: namespaces

Jul 07 2009

Where does Visual Studio get the data intellisense and name-space completion

I admit...I am posting this question because I still don't have an answer to my other question and thought I would take a different tact.

Can someone explain to me WHERE the values for intellisense and namespace/class/member completion works. I figured if I can drill into where/how it is deriving that data I can try to reconfigure my project so that it will resolve my namespaces correctly.


Jul 03 2009

Namespace browsing works correctly in tools and as Imports but not in code window (except imports line)


I posted this question and still have not gotten an answer so I thought I would link to the following video file of the problem...sorry I tried to upload the video to but the downgraded video is unviewable. So here is a direct link to the avi file hosted on my website.

SUMMARY OF THE PROBLEM I have a controls project...GoodMins.MeetingMgr.Winforms.Controls. It has a project reference to GoodMins.MeetingMgr.BizObjects. In ANY code file of GoodMins.MeetingMgr.Winforms.Control I can *Add an Imports to GoodMins.MeetingMgr.BizObjects and intellisense browses the namespace path successfully. *IN THE SAME file Inside the CLASS Declaration I can no longer browse successfully the GoodMins.MeetingMgr.BizObjects namespace.
*But I CAN browse MeetingMgr.BizObjects (which should be an invalid namespace). It does not find thee root GoodMins namespace.

The problem is that when I make a change to the file in the designer...visual studio re-generates the code behind in the designer file and uses the correct namespace. But compile errors occur because Visual Studio does not recognize that namespace.

HELP... I have spent about 3 hours on this tonight to no avail.



I have just noticed something strange in my project which is causing some compile time issues. If you want to get to the bottom line question read the bold text at the bottom of the question. Read it all for all of the behavior details.

I have controls project and in that project I am referencing another bizobjects project.

I use the data source view of my control project to create objects to drop onto the controls and it creates the AttendeesBindingSource. And all of that works fine.

At compile time though I am getting an error in the DESIGNER file of the control:

Me.AttendessBindingSource.DataSource = GetType(GoodMins.MeetingMgr.BizObjects.Attendees)

This has the little squiggley line under GoodMins.MeetingMgr.BizObjects.Attendees with the warning "Type 'GoodMins.MeetingMgr.BizObjects.Attendees' is not defined"

A LITTLE MORE INFORMATION I have figured out how to solve the error.

I simply remove GoodMins. from the reference. In other VS I can change the above line from

Me.AttendessBindingSource.DataSource = GetType(GoodMins.MeetingMgr.BizObjects.Attendees)


Me.AttendessBindingSource.DataSource = GetType(MeetingMgr.BizObjects.Attendees)

and I can compile. When I make a little change to the control reverts the code and I can't compile again.

FYI the Data Source View window Is showing the full namespace of GoodMins.MeetingMgr.BizObjects as the parent I am trying to add

FYI If I try to add an Imports statement (This is a project) Intellisense will not find the project GoodMins.MeetingMgr.BizObjects. But it WILL find the project MeetingMgr.BizObjects.

FYI the Object Browser, when in "View Namespaces" mode, shows the GoodMins.MeetingMgr.BizObjects namespace and does NOT show the MeetingMgr.BizObjects namespace.

One last piece of information. The way I did namespacing in the BizObject project is by removing the namespace declaration from the project properties and putting an explicit namespace declaration around each class file as "Namespace GoodMins.MeetingMgr.BizObjects" ... "End Namespace" I regret doing that and I may change it someday but for now I am stuck with it.

So here is the bottom line to my question...Why do all of the tools built into visual studio want to use the full namespace of GoodMins.MeetingMrg.BizObjects but intellisense in the code window does not recognize the full namespace but will recognize a truncated namespace of MeetingMgr.BizObjects.

I have looked everywhere I know to look and can't figure this one out.