One class not seeing another until I restart VS

T

tshad

I have an irritant more than a problem but was curious why this is happening
and if there is an easier to fix the problem.

I have 2 projects in my solutions: a BusinessLayer class and a DataLayer
class.

My SQL tables will have a file in both with the BusinessLayer inheriting
from the DataLayer class.

They will look something like:

My DataClass file definition (which happens to be in VB) would look like:

Public MustInherit Class GetGroupDetailXrefDC

My BusinessLayer Class would look like:

********************************
using UPS.DataLayer;

namespace UPS.BusinessLayer
{
[Serializable()]
public class GetGroupDetailXref : GetGroupDetailXrefDC
*************************************

Both of the projects build fine.

But I can tell that the BusinessLayer can't seem to see the DataLayer when I
look at the class statement. The GetGroupDetailXref would be highlighted
in blue and the GetGroupDetailXrefDC is in black (should also be blue).

Everything builds fine, as I mentioned.

But if my intellisense doesn't see the properties in the
GetGroupDetailXrefDC class no will it allow me to access them. If I try I
get an error.

If I Clean the solution and rebuild, this still doesn't help.

I have to exit VS and then restart VS to get them to work. That's all.

Anyone know why this doesn't work when I create the files initially?

Thanks,

Tom
 
G

Gregory A. Beamer

Anyone know why this doesn't work when I create the files initially?

Taking a wild guess, you are linked directly to the output DLL rather than
using a project reference, so the project does not know to refresh the data
layer assembly.

Just a guess, but it would certainly display itself in the same way as your
described problem.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
T

tshad

Gregory A. Beamer said:
Taking a wild guess, you are linked directly to the output DLL rather than
using a project reference, so the project does not know to refresh the
data
layer assembly.
Not sure about that, but then why would it see it fine when I closed and
reopened VS?

Thanks,

Tom
 
G

Gregory A. Beamer

Not sure about that, but then why would it see it fine when I closed
and reopened VS?

At that point it refreshes the reference.

In Visual Studio, when you use a project reference, the IDE is aware the
DLL has changed and it automatically refreshes. When you are merely
pointing at a file, it does not.

There is an exception here with ASP.NET (or at least some templates), as
there is a .refresh file it looks through. But the default when you link
to a DLL folder is "hey, this is a library that is stable so we don't
have to slow down compile to check it". With project it says "hey, this
one is another project in this solution, so pay attention".

Also note that the changes will be reflected when you actually run the
application, if the changes are visual, even if you do not see them in
Visual Studio.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top