15,886,110 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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?