Click here to Skip to main content
15,886,110 members

Comments by Aerryc (Top 3 by date)

Aerryc 18-Apr-11 19:59pm View    
I believe I have found my answer and it appears that you are correct; the consumer, ConsoleDemo, must include references to the repositories DemoRepostitory.Devel and DemoRepository.Draft.

I spent several hours of quality time with Rama's MessageBoard example again today and found the references for the repositories listed in the property pages for his consumer, the C:\...\MessageBoard\ WebSite.

Again, thanks for your response.
Aerryc 18-Apr-11 16:18pm View    
Ummm ... to simple? Done and thanks :)
Aerryc 18-Apr-11 15:43pm View    
Thanks for catching the missing using DemoRepository entry in Program.cs; this is necessary to resolve the scope of the DemoSource.GetDemoValue() statement. I have updated the initial post to include this; I also changed the namespace in Program.cs from DataRepository.Core to ConsoleDemo to help reduce confusion. Unfortunately, I still have the same question.

When I include DemoRepository.Devel and DemoRepository.Draft as references in the ConsoleDemo project, everything works fine. In fact, this works regardless of whether or not I add using DemoRepository.Devel and using DemoRepository.Draft to the ConsoleDemo project.

When the repository references are not included, the exception that is returned is:

"Could not load file or assembly 'DemoRepository.Devel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"DemoRepository.Devel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"}

This appears to be a scope resoltion exception and is consistent with your explanation. Based on Rama's MessageBoard example, however, it appears that references to the individual repositories should not be necessary.

In his example, the consumer, MessageBoard.Web (ConsoleDemo in my example), has a reference to MessageBoard.Core (DataRepository) but not to either of the MessageBoard.DataAccess.Linq or MessageBoard.DataAccess.NonLinq repositories (DemoRepository.Devel and DemoRepository.Draft). The repositories also have a reference to MessageBoard.Core. The MessageBoard.Core project, however, does not have a reference to either the consumer or the repositories. Instead, it appears that MessageBoard.Core is only aware of a specific repository through the private CreateMessageProvider() method in MessageSource.cs (DemoSource.cs).

What am I missing?