.NET runtime version in WCSF2010 and Enterprise Library 5

Topics: General discussion
Jan 17, 2012 at 4:00 AM

Hi,

Recently I have migrated my application from .NET3.5, WCSF2008, EnterpriseLibray3.1 to .NET4.0, WCSF2010, Enterprise Library5.

1. After upgrade, when I create new module using WCSF I selected .NET4.0. But I have noticed WCSF sets target framework as .NET3.5 for the new module. Why?

2. Also I noticed the runtime version of WCSF's CompositeWeb.dll is .NET2.0. Shouldn't be .NET4.0?

3. Runtime version of Enterprise Library 5.0 dll's are .NET2.0. Why? I am using .NET4.0 for my projects. How can I change the runtime version of Enterprise Library dlls.

Thanks,

Raja

Jan 17, 2012 at 4:50 AM
Edited Jan 17, 2012 at 4:50 AM

It looks like WCSF2010 requires Microsoft .NET Framework 3.5.  Enterprise Library requires at the minimum Microsoft .NET Framework 3.5 with Service Pack 1.  

.NET 3.5 targets CLR 2.0 so that is why you see the version as 2.0.  See .NET Framework Versions and Dependencies for more info.

If you want to to use .NET 4 version of Enterprise Library assemblies you would have to download the Enterprise Library source code, open the EnterpriseLibrary.2010.sln file with Visual Studio 2010 and rebuild targeting .NET 4.0.


--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Jan 23, 2012 at 10:36 PM

Thanks for your response.

I got the WCSF2010 source code and was able to build the CompositeWeb dlls in .net4.0. Is there any way to change the runtime version of ObjectBuilder.dll ? I didn't find the source code in WCSF2010 source code.

I got the EnterpriseLibrary Update1 source code and was able to build the Enterprise Library dlls in .NET4.0. But I can't update the Unity, Unity.Interception, SeviceLocation dlls ? I didn't find the source code.

Can you advise on this?

Thanks,

Raja

 

 

Jan 24, 2012 at 5:24 AM

You can find ServiceLocator at: http://commonservicelocator.codeplex.com/SourceControl/list/changesets .

Unity source code is located at: http://unity.codeplex.com/SourceControl/list/changesets .

 

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Jan 27, 2012 at 3:42 AM

 

Randy,

I have downloaded source code for ServiceLocation and I found only VS2008 solution. I have converted to VS2010 and built with .NET4.0.

I have downloaded Unity source code and it is throwing errors when I set .NET4.0. I am getting similar errors like below. How should I resolve these errors?

Error 1 Warning as Error: 'System.Security.SecurityCriticalScope' is obsolete: 'SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.' D:\IRIS-2010\SAMPLES\unity-67949\Unity\Unity.Interception\Src\Interceptors\InstanceInterceptors\TransparentProxyInterception\TransparentProxyMethodReturn.cs 26 23 Unity.Interception

 

Thanks,

Raja

CapitalOne Services

Jan 27, 2012 at 6:50 AM

It sounds like you have treat warnings as errors enabled.  You can disable obsolete warnings for that project.  You can do it via Project Properties->Build->Suppress warnings and enter 618.

Or you can do it for the specific spots in the code that are causing errors:

    #pragma warning disable 618
    [SecurityCritical(SecurityCriticalScope.Everything)]
    #pragma warning restore 618

FYI: It looks like Unity 3 preview has those attributes removed. 

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Jan 27, 2012 at 3:12 PM

I set Suppress warnings and entered 618. I built the dlls. But when I run through my application, I am getting the following error.

Method 'Microsoft.Practices.Unity.InterceptionExtension.Interception.Initialize()' is security transparent, but is a member of a security critical type.

Description:

 

An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Method 'Microsoft.Practices.Unity.InterceptionExtension.Interception.Initialize()' is security transparent, but is a member of a security critical type.

Thanks,

 Raja