.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Error "unable to find a version of the runtime to run this application .net framework"

Posted By: kamlesh     Posted Date: August 20, 2012    Points:5   Category :C#
Hi,

I have develop one application in "Visual Studio 2008" and create exe of that application. that exe i run on windows server 2003,and i have install "dot net framework 4.0".
when i run application it gives me initialization error "unable to find a version of the run-time to run this application .net framework"

Please give me solution for this.

Thanks and Regards.
Kamlesh Nikam

Responses
Author: kamlesh             
Posted Date: August 22, 2012     Points: 20   

Hi,
I found One Solution, add App.Config file in your project and insert

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v1.0.3705" />
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration>

this code and build in release mode,
it will work on every Framework.

Thanks And Regards.
Kamlesh Nikam


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend