VS 2005 and CSLA 3.5

VS 2005 and CSLA 3.5

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


AaronH posted on Saturday, January 17, 2009

Just wondering if anyone out there has had success using CSLA 3.5 with VS 2005 and .NET Framework 3.5?  I tried compiling the C# version, but am receiving:

 Error 1 The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?) 

Has anyone else run into this issue?  Were you able to get it to work, if so, how?

Rocky, any ideas?

Thanks!

tmg4340 replied on Saturday, January 17, 2009

CSLA 3.5 and up uses .NET 3.5, which is only supported in Visual Studio 2008.

3.0.4 is the latest version that's usable in VS 2005, I think.

HTH

- Scott

AaronH replied on Saturday, January 17, 2009

Hi Scott, actually, it is possible to reference 3.5 assemblies in VS2005.  The 2.0, 3.0, and 3.5 .NET assemblies all target the 2.0 CLR.  I'm thinking that the CSLA 3.5 project file was created with VS2008 and is referencing something that I have not set/referenced when opening the file up with VS2005.  Of course, I could be way off, but that's what I'm thinking at this point.

I'll keep digging but I'm hoping that someone has been through this roadblock and can offer some valuable insight.

Thanks again.

ajj3085 replied on Monday, January 19, 2009

You can reference the 3.5 assemblies all you want, but it's still using the 2.0 compiler.  var is a 3.5 compiler feature, and I don't know of any way to make vs2005 use the 3.5 compiler.

RockfordLhotka replied on Saturday, January 17, 2009

CSLA .NET 3.5 requires VS 2008 and .NET 3.5. It uses language features of C# and VB that only exist in the .NET 3.5 compilers.

Once you compile the DLL you may be able to use it from VS 2005 projects, but you need the .NET 3.5 compilers to build Csla.dll.

AaronH replied on Saturday, January 24, 2009

Thanks Rocky, that ended up working great!  Now to get my company to hop on the vs08 wagon..

prabhatasp replied on Monday, February 02, 2009

hi all,

i am not familier with CSLA. Can any one tell me how can we use CSLA with my web project? Can i use CSLA with VS 2005?

i have download CSLA 2.0 for VS 2005 but there is no setup file is available there. And when i want to add CSLA.dll under .Net framework Component then i am getting an error as:

'E:csla.dll' could not load type
'System.ComponentModel.INotifyPropertyChanging' from assembly
 'System, Version=2.0.0.0, Culture=Neutral, PublicKeyTocken=b77a5c561934e089'.'

while, when i want to add CSLA.dll under COM Component then i am getting an error as:

The type library E:csla.dll could not be loaded


ajj3085 replied on Monday, February 02, 2009

FYI, the latest version that targets the .Net 2 framework is 3.0.x, I believe.  To compile, you're need to define the NET20 compiler symbol.  There's documentation on Rocky's site that gives more detail on how to use 3.0.x on .Net 2.0.

Copyright (c) Marimer LLC