net framework 4.0 compatibility

19
.NET Framework Compatibility support .NET 4.0 with PowerBuilder Samuel Chen

Upload: samuel-chen

Post on 15-Dec-2014

56 views

Category:

Software


5 download

DESCRIPTION

The .NET framework compatibility research presentation for pre-upgrading.

TRANSCRIPT

Page 1: NET framework 4.0 compatibility

.NET Framework Compatibility

support .NET 4.0 with PowerBuilder

Samuel Chen

Page 2: NET framework 4.0 compatibility

.NET Framework 4.0 is highly compatible.

Which means it does NOT fully backward compatible.

Page 3: NET framework 4.0 compatibility

1.Legacy feature2.New feature3.Undefined behavior change.4.Bug fixing

Microsoft highly recommended to use the appropriate .NET version which the application was built against. 

Page 4: NET framework 4.0 compatibility

An earlier application(.exe) can not run over .NET 4.0.

But an earlier assembly/lib(.dll) can run as a part of a 4.0 app.

Page 5: NET framework 4.0 compatibility

Runs against another version of .NET framework

add to appname.exe.config

<?xml version="1.0"?><configuration>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

</configuration>

Page 6: NET framework 4.0 compatibility

Runs against latest version of .NET framework

Add a Key "OnlyUseLatestCLR"=dword:00000001 in registry.

·         On 32-bit computers, set the registry key under the following node:[HKEY_LOCAL_COMPUTER\SOFTWARE\Microsoft\.NETFramework]

·         On 64-bit computers that are running 32-bit applications, set the registry key under the following node:[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]

·         On 64-bit computers that are running 64-bit and 32-bit managed applications, set the registry key under both of the following nodes:[HKEY_LOCAL_COMPUTER\SOFTWARE\Microsoft\.NETFramework][HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ Microsoft\.NET Framework]

Page 7: NET framework 4.0 compatibility

Everywhere we see

"Report bug to me if it crashes!"

                                              Microsoft

Page 8: NET framework 4.0 compatibility

New compatibility strategy : In-Process Side by Side

Component A is developed against .NET 1.1Component B ............................... .NET 2.0Component C ............................... .NET 4.0

Run in same process.

Page 9: NET framework 4.0 compatibility

But     In-Proc  SxS only available on 4.0 or later.

So     1.1 and 2.0 in same process -- NO  1.1/2.0 and 4.0/later in same process -- YES

Page 10: NET framework 4.0 compatibility

Difference in ASP.NET

To deploy a web app targets earlier version, We must configure the application in IIS to use the targeted version of the .NET Framework.

Page 11: NET framework 4.0 compatibility

Difference in ASP.NET

To deploy an web app contains a nested app targets to diff version of the CLR, does In-Proc SxS work?

If an IIS Web application that targets the .NET Framework 3.5 or earlier is nested within an IIS Web application that targets the .NET Framework 4, the compiler might report errors when it compiles the nested application. 

Versions before 4 do not support.

Page 12: NET framework 4.0 compatibility

Difference in ASP.NET

To run an web app contains components targets multi-versions of the CLR?

ASP.NET app runs in application pool. A pool runs in a process. One version, one pool. (CLR)It is not possible to run multi-version of the CLR in same pool even .NET 4 supports in-proc side by side.

Page 13: NET framework 4.0 compatibility

So for ASP.NET application, we need to

•  Install the target .NET framework•  Config the application to target to correct

CLR

Page 14: NET framework 4.0 compatibility

Resolution 1

• Request customer to install appropriate .NET framework.

Safe and stable.

Page 15: NET framework 4.0 compatibility

Resolution 2

• Generate app.config for winform applications.

Unsafe, unstable and may not work for most enterprise applications.

Page 16: NET framework 4.0 compatibility

Resolution 3

• Support deploying to different versions of the CLR.

• Maintain multi-sets of our assemblies. • Provide config option to choose which

version of the CLR to build against.

Safe, stable but need more effort.

Page 17: NET framework 4.0 compatibility

Microsoft is not going to support 3.5 and earlier versions from now on.

Page 18: NET framework 4.0 compatibility

Resources:

http://msdn.microsoft.com/en-us/library/ms171868(VS.100).aspx

http://msdn.microsoft.com/en-us/library/dd889541.aspx

http://msdn.microsoft.com/en-us/magazine/ee819091.aspx

http://msdn.microsoft.com/en-US/library/dd329360.aspx

http://msdn.microsoft.com/en-US/library/dd329554.aspx

http://www.infoq.com/news/2010/04/Migration-Issues-.NET-4.0

http://blogs.msdn.com/silverlightshanghai/archive/2009/08/25/net-4-0-in-process-side-by-side.aspx (zh-cn)

Page 19: NET framework 4.0 compatibility

Thanks !