Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 5th, 2010, 11:10 AM
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
 
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>
 
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
 
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
 
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)
 
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
 
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





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 12: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 02: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 03: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.