Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Silverlight 4 Problem - Design - Solution
This is the forum to discuss the Wrox book Silverlight 4 Problem - Design - Solution by Nick Lecrenski; ISBN: 9780470534045
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Silverlight 4 Problem - Design - Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 5th, 2010, 12:10 PM
Registered User
 
Join Date: Nov 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Build error

Hello,

Im getting this annoying build error on chapter 3 and cant seem to resolve it.
It happens when building the silverlight project rather than the web project and results in me not being able to access the WebContext class.

The actual error is 'Sequence contains more than one element'
My setup is as follows
Visual Studio 2010 Pro
Silverlight 4 tools for VS2010
Silverlight 4 SDK
RIA services toolkit v4.0.50506.0
RIA Services v1.0 v4.0.50506.0

The detailed error is as follows (in MSBuild log)

C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft .Ria.Client.targets(303,5): error : Sequence contains more than one element
Generating proxy classes for the DomainService 'DartsStats.Web.Services.AuthenticationService'.
Generating WebContext class.
The client proxy task generated or is reusing existing copies of these files:
RIA client proxy class generation finished in 0.425 seconds.
Done executing task "CreateRiaClientFilesTask" -- FAILED.
Done building target "CreateRiaClientFiles" in project "DartsStats.csproj" -- FAILED.

Ive started from scratch twice but to no avail
NB when i initially start the project and select 'enable RIA services' I CAN access the WebContext class its only after this error that I cant.

Any help much appreciated
Scott Williamosn
Reply With Quote
  #2 (permalink)  
Old November 7th, 2010, 03:23 AM
Authorized User
 
Join Date: Sep 2009
Posts: 34
Thanks: 4
Thanked 1 Time in 1 Post
Default

Does the WebContext object is in App.xaml file as ApplicationLifetimeObject?
Code:
    <Application.ApplicationLifetimeObjects>
         <app:WebContext>
            <app:WebContext.Authentication>
                <services:FormsAuthentication />
            </app:WebContext.Authentication>
        </app:WebContext>
    </Application.ApplicationLifetimeObjects>
Reply With Quote
  #3 (permalink)  
Old November 8th, 2010, 10:46 AM
Registered User
 
Join Date: Nov 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Gabor,
Thanks for the reply. Ive got that in app.xaml but <app:WebContext> is not recognised (through intellisense).
Ive double checked correct namespaces. Its strange as before this build error no problems with WebContext
Reply With Quote
  #4 (permalink)  
Old November 8th, 2010, 12:44 PM
Registered User
 
Join Date: Nov 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update

Right Ive just rebuilt my PC and have a nice new clean build of all Visual Studio 2010 Pro, Silverlight 4 etc etc

When using the downloaded code from Wrox I can get a clean build but as soon as I add a Domain Service I get the error message 'Sequence can only contain one element' and the WebContext doesnt resolve.

The error is occuring in the microsoft.ria.client.targets dll in C:/MSBuild folder

TBH I cant get through this problem as its definetly not related to my setup and am going to have to give up on the book or perhaps try the entity framework

Id be interested to hear if anyone else is getting this problem with RIA Services
Reply With Quote
  #5 (permalink)  
Old November 9th, 2010, 03:15 AM
Authorized User
 
Join Date: Sep 2009
Posts: 34
Thanks: 4
Thanked 1 Time in 1 Post
Default

Did You install the RIA Services toolkit? The Microsoft moved the Linq2Sql to there. The standard RIA services doesn't install the Linq2Sql Domain Context, as described in this thread:

LINQ to SQL Context not visible to Domain Service Class (P 114)
Reply With Quote
  #6 (permalink)  
Old November 9th, 2010, 05:43 AM
Registered User
 
Join Date: Nov 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I have the latest RIA Toolkit but still getting the problems. Im giving up on LinqToSql and going to try the EF.

The author has picked the wrong technology there but cant really blame him as MS has only recently decided to phase out LinqToSQL. A pain if following the book closely though
Reply With Quote
  #7 (permalink)  
Old November 18th, 2010, 03:26 AM
Authorized User
 
Join Date: Sep 2009
Posts: 34
Thanks: 4
Thanked 1 Time in 1 Post
Default

The author claimed in april, that LINQ2SQL is lighter, simpler and quicker than EF, and if You don't want to port the dataaccess to a database other than MS SQL server, this is a reasonable choice.

From that time nothig changed, the EF v.4. is the same as was in that time. (The new version is in CTP only).

Because in my application LINQ2SQL works perfectly, in your application the problem caused not by LINQ2SQL per se; maybe some settings are missed.

Switching to EF (wich isn't as easy as seemed) may not remedies Your problem.

Please let me know if found any solution

Gabor
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build Error venessaz BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 46 March 30th, 2016 01:25 PM
Anybody knos why I'm getting build error? krahman01 BOOK: ASP.NET 3.5 Website Programming Problem Design Solution 9 July 30th, 2010 03:21 AM
C# - Chapter 3 Build Error TJ BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 July 29th, 2006 04:43 PM
Build Error - Plz Help - Thanks ank2go ASP.NET 1.0 and 1.1 Basics 1 February 23rd, 2004 10:09 PM
error on build stewbaby C++ Programming 1 October 30th, 2003 06:07 PM



All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.