开发者

Running application compiled with visual studio 2008 on .net 4 computer

I've compiled an application with vs 2008 and .net framework 3.5.

I t开发者_StackOverflow社区ried to run this application on computer with only .net framework 4 (.net framework 3.5 is not installed) and I've got an error (says that it can't load the assembly ....ServiceModel.... version 3.0).

After installing .net framework 3.5 SP 1 it works.

I have found a documents says that .net framework is backward compatible: http://msdn.microsoft.com/en-us/library/ff602939.aspx

Am I missing something? I there a way to compile an application in vs 2008 and be able to run it on a computer with .net framework 4 only?

Thanks.


From this MSDN page.

The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework. To run older applications with .NET Framework 4, you must compile your application with the target .NET Framework version specified in the properties for your project in Visual Studio, or you can specify the supported runtime with the Element in an application configuration file.

So the best thing would probably be to install the 3.5 framework, but otherwise try changing the supportedRuntime element in the app.config.


The .NET Framework 4 can run .NET Framework 2 and up applications. However, you have to install the full version of the framework. The general redistributable packages only ship with the "client profile" -- a subset of the available classes and methods in the framework.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜