Trick for compiling with SL3?

Trick for compiling with SL3?

Old forum URL: forums.lhotka.net/forums/t/6987.aspx


pondosinat posted on Friday, May 22, 2009

I've been trying to get the CSLALight builds 3.6.1-3 to compile with my new SL 3 installation but cannot get around the error "Failed to generate code for the service reference 'WcfPortal'". If anyone has done this successfully, what is the work around?

I tried turning off the "Reuse types in referenced assemblies" option but then of course my app can no longer connect to the server. I'm going to keep working on this but if anyone has any insight I would greatly appreciate it!

Thanks,

Brian

ajj3085 replied on Friday, May 22, 2009

Search the forum, as I think this has come up.

The bad news is that so far SL3 isn't supported by Csla.. so you're largely on your own at this point.

pondosinat replied on Friday, May 22, 2009

I posted to the one thread I could find on this but am awaiting response--that thread contains more unanswered questions than solutions. I do realize that SL3 is beta and, as such, is not supported by Csla. I'm looking for any insight from people who may have gotten this working.

Thanks

sergeyb replied on Friday, May 22, 2009

I was able to compile CSLA for Silverlight using SL 3.0.  Here are the steps.

1.      Update CSLA for .NET solution

a.      Add web project to expose data portal.  Use you can use project from svn - \cslalighttest\UnitTest\Web

b.      This project was used to generate the initial reference to Wcf Portal for CSLA for SL

c.       Setup startup project to web and run the solution

d.      Portal info should now be available for CSLA SL solution.   You can test this in browser by using WcfPortal.svc in the browser URL

2.      Open CSLA light solution

a.      Right click on service reference to WcfPortal and select configure

b.      Uncheck re-use types in all referenced assemblies (root cause of the problem – at least appears to be)

c.       Check all assemblies listed with exception of System

d.      Click OK

e.      You now should be able to update assembly reference and generate proxy classes, then compile entire solution

f.        I also had to remove and re-add reference to System.Windows.Controls.Data (SL Data Grid stuff)

3.      You can now remove Web project from CSLA for .NET solution

 

Disclaimer: I did not verify that compiled CSLA for SL assembly actually works – ran out of time

 

 

 

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: pondosinat [mailto:cslanet@lhotka.net]
Sent: Friday, May 22, 2009 1:49 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] Trick for compiling with SL3?

 

I posted to the one thread I could find on this but am awaiting response--that thread contains more unanswered questions than solutions. I do realize that SL3 is beta and, as such, is not supported by Csla. I'm looking for any insight from people who may have gotten this working.

Thanks



pondosinat replied on Friday, May 22, 2009

Sergey,

Thanks for detailing out those steps! I was hoping that unchecking the "System" reference would be the answer but unfortunately still getting the same error from the client when trying to run the Silverlight app- "Could not find default endpoint element that references contract 'WcfPortal.IWcfPortal' in the ServiceModel client configuration section.

I'm digging further to see what this error is...

Thanks again for your help,

Brian

sergeyb replied on Saturday, May 23, 2009

I am guessing it is a namespace issue.  Could you see what you have in references.cs file – you can look for IWcfPortal interface.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: pondosinat [mailto:cslanet@lhotka.net]
Sent: Friday, May 22, 2009 5:35 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Trick for compiling with SL3?

 

Sergey,

Thanks for detailing out those steps! I was hoping that unchecking the "System" reference would be the answer but unfortunately still getting the same error from the client when trying to run the Silverlight app- "Could not find default endpoint element that references contract 'WcfPortal.IWcfPortal' in the ServiceModel client configuration section.

I'm digging further to see what this error is...

Thanks again for your help,

Brian



pondosinat replied on Monday, May 25, 2009

Hi Sergey,

Good news! I was able to get my SL3 app to run successfully with CSLA. I ended up just running a diff on the two CslaLight folders--the first being the version before auto-upgrading to SL3 and the other after the upgrade. Sure enough, the VS auto-upgrade totally wipded out the references.cs file. So, I just replaced that file with the original 3.6.2 version and everything worked! No need to add or remove references. Here is a quick step by step to get CSLA working with SL3:

1) Auto-upgrade the CslaLight solution in VS.

2) Replace the file /Service References/WcfPortal/Reference.cs with the original version before the auto-upgrade.

3) Update any references to CSLA in your client app.

That's it!

Thanks again,

Brian

StuartBale replied on Saturday, June 27, 2009

Woo Hoo

This works!

I also had to update the System.Windows.Controls.Data reference to the new SL3 assembly.

RockfordLhotka replied on Sunday, June 28, 2009

StuartBale:
I also had to update the System.Windows.Controls.Data reference to the new SL3 assembly.

This is because in 3.6.x the reference to that assembly is version-specific.

As someone noted in another thread, perhaps I should change that. But really I shouldn't, because there are two versions of that assembly floating around for SL2 - and only the December 08 one actually works (and that's not that one that comes with the SDK).

Hopefully in 3.7 I'll be able to change the reference so it is not version-specific, and that'll simplify the process.

Copyright (c) Marimer LLC