Errors building Rolodex solution for CSLA.NET for Silverlight

Errors building Rolodex solution for CSLA.NET for Silverlight

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


FCazabon posted on Friday, October 16, 2009

Hi,

It's been a looong time since I used CSLA.NET and Visual Studio. I am looking at doing a system using Silverlight and have downloaded the relevant files from the downloads section.

I am using VS2008. CSLA.NET 3.7.1 and Silverlight 3.0

I also downloaded and installed the Silverlight tools.

I opened the csla.sln and built it, then the cslalightcs.sln and built that.

Then I opened the Rolodex solution, fixed the csla references (by removing them and adding them back in) and tried to build that, but got some errors and warnings. Is there something that I've missed out?

Here are the errors, there are 6 warnings as well that I can post here if it will help diagnose my problems:

Error 1 The call is ambiguous between the following methods or properties: 'Csla.PropertyInfo.PropertyInfo(string, string, Csla.RelationshipTypes)' and 'Csla.PropertyInfo.PropertyInfo(string, string, decimal)' C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\Rolodex\Business\Server\BusinessClasses\CompanyContact.cs 109 89 Rolodex.Business.Client

Error 2 The call is ambiguous between the following methods or properties: 'Csla.PropertyInfo.PropertyInfo(string, string, Csla.RelationshipTypes)' and 'Csla.PropertyInfo.PropertyInfo(string, string, decimal)' C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\Rolodex\Business\Server\BusinessClasses\CompanyContact.cs 109 89 Rolodex.Business.Server

Error 7 Metadata file 'C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\Rolodex\Business\Client\Bin\Debug\Rolodex.Business.dll' could not be found Rolodex

Error 8 The type or namespace name 'SilverlightControls' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?) C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\Rolodex\Web\Default.aspx.designer.cs 50 41 Web

Error 9 Metadata file 'C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\Rolodex\Business\Server\bin\Debug\Rolodex.Business.dll' could not be found WcfHostWeb

Thanks for any insight

FCazabon replied on Monday, October 19, 2009

Have I asked my question badly? Is there more information that I need to provide?

RockfordLhotka replied on Monday, October 19, 2009

It is possible Rolodex won't build on 3.7.1. I don't have time to update every sample for each release of CSLA .NET, and I don't think Sergey (who originally authored that sample) had time to update it either.

fwiw, I know Sergey has updated Rolodex for 3.8.0, so when Beta 2 comes out there'll be a couple working versions of Rolodex to look at.

FCazabon replied on Monday, October 19, 2009

Thanks,

which samples are safe to look at right now then?

RockfordLhotka replied on Monday, October 19, 2009

My primary test app is InventoryDemo.

FCazabon replied on Monday, October 19, 2009

Thanks very much. I'll try that one out.



I opened that solution and got this warning:

The referenced component 'System.Web.Silverlight' could not be found.

Do you have any idea why this would not be available?

Frank

FCazabon replied on Tuesday, October 20, 2009

Hi Rocky,

When I tried to build that solution I got a message that

The referenced component 'System.Web.Silverlight' could not be found.

Google brought me to a page that said this was no longer part of Silverlight 3.0, so does your test solution need changing to reflect this or was this site incorrect?

Thanks for any help,

Frank

sergeyb replied on Tuesday, October 20, 2009

You can still download this DLL if you would like, although this is not a recommended by Microsoft. You can just create a new project, open up generated aspx file, and copy that code into the aspx page in Rolodex, then just change the source to correct xap file.

Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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

-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Tuesday, October 20, 2009 8:29 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Errors building Rolodex solution for CSLA.NET for Silverlight

Hi Rocky,

When I tried to build that solution I got a message that

The referenced component 'System.Web.Silverlight' could not be found.

Google brought me to a page that said this was no longer part of Silverlight 3.0, so does your test solution need changing to reflect this or was this site incorrect?

Thanks for any help,

Frank

FCazabon replied on Thursday, October 22, 2009

Hi Sergey,

thanks for jumping in. I'm not quite sure what you are telling me to do.

1. download the System.Web.Silverlight.dll

I cannot locate this file on the internet anywhere (except from one or two fishy looking sites). Where/how would you recommend I get it?

2. I am very new to the whole VS thing, so please bear with me. I created a new Silverlight project in VS2008, then looked at the default.aspx in this new project . This was the code:

(I tried to paste the code here and put it between pre tags, but that didn't work, how can I do that on this forum?)

It looks quite different to the one in the Rolodex project so I am unsure if overwriting this code is what you meant me to do.

3. I don't understand what you mean by "then just change the source to correct xap file." I did not see any reference to a xap file in this code. Could you clarify, please?

Thanks,

Frank

sergeyb replied on Thursday, October 22, 2009

The dll is part of Silverlight 2.0 SDK. If you download and install it, it will be located in SDK folder under program files.
Just take the whole aspx file like below. Look for param name="source" and put in correct application name/xap file name.





SilverlightInitParams

html, body
{
height: 100%;
overflow: auto;
}
body
{
padding: 0;
margin: 0;
}
#silverlightControlHost
{
height: 100%;
text-align: center;
}





function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != 0) {
appSource = sender.getHost().Source;
}

var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode;

if (errorType == "ImageError" || errorType == "MediaError") {
return;
}

var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";

errMsg += "Code: " + iErrorCode + " \n";
errMsg += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";

if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}

throw new Error(errMsg);
}






width="100%" height="100%">





" />

Get Microsoft Silverlight style="border-style: none" />


border: 0px">





Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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


-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Thursday, October 22, 2009 8:40 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: Errors building Rolodex solution for CSLA.NETfor Silverlight

Hi Sergey,

thanks for jumping in. I'm not quite sure what you are telling me to do.

1. download the System.Web.Silverlight.dll

I cannot locate this file on the internet anywhere (except from one or two fishy looking sites). Where/how would you recommend I get it?

2. I am very new to the whole VS thing, so please bear with me. I created a new Silverlight project in VS2008, then looked at the default.aspx in this new project . This was the code:



















It looks quite different to the one in the Rolodex project so I am unsure if overwriting this code is what you meant me to do.

3. I don't understand what you mean by "then just change the source to correct xap file." I did not see any reference to a xap file in this code. Could you clarify, please?

Thanks,

Frank

FCazabon replied on Thursday, October 22, 2009

I have downloaded the Silverlight 2 SDK, thanks.

Could you clarify exactly what aspx file I am supposed to put this in for the Rolodex application (assuming that is the app you are talking about). I am not finding any aspx page which has anything like that in it. FWIW I am not seeing a line that says

param name="source"

in what you posted either.

sergeyb replied on Thursday, October 22, 2009

Default.aspx under Web project. There is no .

Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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


-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Thursday, October 22, 2009 2:17 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: RE: Errors building Rolodex solution forCSLA.NETfor Silverlight

I have downloaded the Silverlight 2 SDK, thanks.

Could you clarify exactly what aspx file I am supposed to put this in for the Rolodex application (assuming that is the app you are talking about). I am not finding any aspx page which has anything like that in it. FWIW I am not seeing a line that says


param name="source"

in what you posted either.


sergeyb replied on Thursday, October 22, 2009

Default.aspx.



Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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


-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Thursday, October 22, 2009 2:17 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: RE: Errors building Rolodex solution forCSLA.NETfor Silverlight

I have downloaded the Silverlight 2 SDK, thanks.

Could you clarify exactly what aspx file I am supposed to put this in for the Rolodex application (assuming that is the app you are talking about). I am not finding any aspx page which has anything like that in it. FWIW I am not seeing a line that says


param name="source"

in what you posted either.


RockfordLhotka replied on Thursday, October 22, 2009

For InventoryDemo, you can grab the latest aspx file here:

http://www.lhotka.net/cslacvs/viewvc.cgi/samples/trunk/CslaLight/cs/InventoryDemo/InventoryDemo.Web/InventoryDemoTestPage.aspx?view=log

But since it was changed back in August, the 3.7.1 download should surely have the right version already.

FCazabon replied on Tuesday, October 27, 2009

Hi Rocky,

I don't need the latest aspx file as it is already there. However, when I build the InventoryDemo solution I get 4 errors:

Error 1 The type 'System.Collections.ObjectModel.ObservableCollection`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\WarehouseList.cs 11 33 InvDal

Error 2 The type 'System.ComponentModel.IEditableObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\ProductEdit.cs 13 31 InvDal

Error 3 The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\ProductDetail.cs 13 33 InvDal

Error 4 Metadata file 'C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\bin\Debug\InvDal.dll' could not be found InventoryDemo.Web

Do any of those tell you what I am doing wrong?

sergeyb replied on Tuesday, October 27, 2009

Maybe you do not have Silverlight SDK installed? The last error is just a result of the first three.

Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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

-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Tuesday, October 27, 2009 10:03 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] Errors building Rolodex solution for CSLA.NET for Silverlight

Hi Rocky,

I don't need the latest aspx file as it is already there. However, when I build the InventoryDemo solution I get 4 errors:

Error 1 The type 'System.Collections.ObjectModel.ObservableCollection`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\WarehouseList.cs 11 33 InvDal

Error 2 The type 'System.ComponentModel.IEditableObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\ProductEdit.cs 13 31 InvDal

Error 3 The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\ProductDetail.cs 13 33 InvDal

Error 4 Metadata file 'C:\Documents and Settings\frank\My Documents\Visual Studio 2008\Projects\csla\CslaLight\cs\InventoryDemo\InvDal\bin\Debug\InvDal.dll' could not be found InventoryDemo.Web

Do any of those tell you what I am doing wrong?

FCazabon replied on Tuesday, October 27, 2009

I have Silverlight3_tools installed. Can't remember where I was told that this was what I should install. Is it the correct thing or should I download and install this http://www.microsoft.com/DOWNLOADS/details.aspx?familyid=1EA49236-0DE7-41B1-81C8-A126FF39975B&displaylang=en too?

FCazabon replied on Tuesday, October 27, 2009

I tried to download and install the silverlight 3 sdk by itself and it told me that another version of this product is already installed. Control Panel Add or Remove Programs confirms the Microsoft Silverlight 3 SDK is installed.

I uninstalled and installed from the plain Silverlight 3 SDK installer and still have the same errors.

RockfordLhotka replied on Tuesday, October 27, 2009

I recommend using the web installer tool - it should make sure you have what
you need.

FCazabon replied on Tuesday, October 27, 2009

Could you specify what web installer tool and where to find it, please? Do you mean the Microsoft Web Platform Installer available here: http://www.microsoft.com/web/gallery/install.aspx?appsxml=&appid=VWD%3bSilverlight3Tools ?


If that is what you are referring to, then it says I have everything installed.

RockfordLhotka replied on Tuesday, October 27, 2009

Yes, the web platform installer.

FCazabon replied on Wednesday, October 28, 2009

Thanks. Does anybody have any ideas why I am getting those errors even though I have everything I need installed?

Later:

I found the System.dll and System.Windows.dll in this path: C:\Program Files\Microsoft Silverlight\3.0.40818.0 but first had to remove the reference to the existing System.dll which was apparently version 2 whereas it should have been version 3.

Now, lets see if I can get this solution to run... :)

sergeyb replied on Wednesday, October 28, 2009

Double-check your references.

Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

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

-----Original Message-----
From: FCazabon [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 28, 2009 8:07 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: RE: Errors building Rolodex solution for CSLA.NET forSilverlight

Thanks. Does anybody have any ideas why I am getting those errors even though I have everything I need installed?


RockfordLhotka replied on Wednesday, October 28, 2009

Or go get the 3.8.0 Beta 2 samples, which I know Sergey updated.

I don't know for sure that the 3.7.x samples were updated for Silverlight 3 - in which case it makes sense that you need to update the references before it would work.

FCazabon replied on Wednesday, October 28, 2009

Well, this is the InventoryDemo sample which you said is the one to use (I have not tried the Rolodex one since you said Sergey had not updated it).

I did get it compiled, but when I try to run it I get more errors. :(

I will download the 3.8.0 Beta 2 and try that instead. Hopefully it will give me less of a headache than this one has. :)

Copyright (c) Marimer LLC