Working with CSLA CE for WIndows Mobile 5.0 app - error The type 'xxx' is defined in an assembly that is not referenced

Working with CSLA CE for WIndows Mobile 5.0 app - error The type 'xxx' is defined in an assembly that is not referenced

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


adrian.nasui posted on Friday, March 28, 2008

I inherit my class from BusinessBase:

using System;

using System.Collections.Generic;

using System.Text;

using CslaCE;

namespace MyApp.ClassLibrary

{

public class ItemCls : BusinessBase<ItemCls>

{

 

}

}

and I get:

Error 1 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.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

 

The reference to System is obviously added...

This happens wenever I use any class that's part of CSLA CE. (Actually until now I have only tried to use the SafeDataReader, and obtained the same effect)

Any hints? Thanks.

adrian.nasui replied on Friday, March 28, 2008

I had created a main project (of type device application) and this project would reference CSLACE.

I encountered two problems.

1. The error described above.

2. I tried running the app on my WM 5.0 emulator, with a reference to CSLACE in my main project, (without referencing any classes from CSLA CE as it would have generated error #1), and I found out that the deployment also included the desktop Microsoft .NET 2.0 framework, which of course gave me an "insuficient disk space" error on the emulator. This did not occur if I removed CSLACE from the main project references.

 

My solution was this.

I created a new WM 5.0 ClassLibrary named, let's say, CSLAMobile, copied the CSLACE resource file in CSLAMobile properties, built the project, then copied all source files from CSLACE to CSLAMobile, remove serialization attribute and adjust namespaces, etc.

Now I can use CSLAMobile and it works fine.

cheers.

lawrencek replied on Tuesday, April 08, 2008

Two things I can think of at the moment.

1. Check out the latest code from svn

2. You can remove the references to the system dll's and then add them back.

 

pillesoft replied on Monday, January 26, 2009

thanks!

i had the same problem, and your proposal works
even i downloaded the package from here (not from svn) (cslacecs-3.0.2-070911)

Ivan

Copyright (c) Marimer LLC