Csla 4.5.4 .NET 4

Csla 4.5.4 .NET 4

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

aramka posted on Wednesday, December 05, 2012

Im trying to upgrade to Csla 4.5.4 from 4.2.2. Im using VS 2010 v10.0.40219.1 SP1Rel and targeting .NET framework 4. When i switch the references i get the following exception:

Could not load type 'System.Runtime.CompilerServices.IAsyncStateMachine' from assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


   at Csla.DataPortal`1.DoCreateAsync(Type objectType, Object criteria, Boolean isSync)

   at Csla.DataPortal`1.Create(Type objectType, Object criteria)

   at Csla.DataPortal`1.Create(Object criteria)

   at Csla.DataPortal.Create[T](Object criteria)

   at Csla.DataPortal.Create[T]()

   at Core.Sebring.BusinessObjects.DocTypes.EditableCategory.NewEditableCategory() in D:\Development\Core\Sebring\Sebring\Core.Sebring.BusinessObjects\DocTypes\EditableCategory.cs:line 305

   at Core.Sebring.BusinessObjects.Test.EditableCategoryTest.EditableCategory_InvalidTableAddedWheresMyBrokenRule() in D:\Development\Core\Sebring\Sebring\Core.Sebring.BusinessObjects.Test\DocTypes\EditableCategoryTest.cs:line 399

Any help is greatly appreciated. Thank you.



tiago replied on Wednesday, December 05, 2012


You should add a reference to AsyncTargetingPack. If you install Csla from NuGet everything you need will be automaticaly installed.

aramka replied on Wednesday, December 05, 2012

Thanks for your reply. Im using the VS 2010. from what I have read the AsyncTargetingPack is for VS 2012. Can I use CSLA 4.5.4 with VS 2010? Or do I have to upgrade to VS 2012 if I want to use CSLA 4.5.4?

tiago replied on Thursday, December 06, 2012

Hi aranka,

VS2012 is required only if you are targeting .NET 4.5

If you are using VS2010, you must target .NET 4 but you can reference (and use) CSLA 4,5.x, provided you add a reference to the AsyncTargetingPack.

Installing CSLA using NuGet will automatically solve the AsyncTargetingPack reference.


If you are using VS2010, you can't use the async/await keywords.


aramka replied on Thursday, December 06, 2012

Thanks alot. I appreciate your help.

Copyright (c) Marimer LLC