2015-03-24 25 views
2

我想針對同一個輸出構建(EXE)多個.net框架。如何針對同一構建多個.net框架

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
<PropertyGroup> 
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
<ProductVersion>9.0.30729</ProductVersion> 
<SchemaVersion>2.0</SchemaVersion> 
<ProjectGuid>{B4436616-28A2-4B98-9C39-3DA4AC95537E}</ProjectGuid> 
<OutputType>WinExe</OutputType> 
<AppDesignerFolder>Properties</AppDesignerFolder> 
<RootNamespace></RootNamespace> 
<AssemblyName></AssemblyName> 
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 

我的應用程序與2.0 3.0 3.5一起工作,我想在我的應用程序中的所有目標。

有什麼想法?

+0

爲什麼你想要定位多個版本?如果你只是想讓你的程序集與每個版本兼容,那麼爲.NET 2.0構建它,它可以與更高版本一起工作。如果你想生成幾個EXE,每個EXE都以不同的版本爲目標,有一些策略可以這樣做,但它要複雜得多。 – 2015-03-24 23:27:53

+0

,因爲有些人沒有2.0,例如,如果我建立它爲2.0和4.0的用戶只有它不工作。 (我試過它已經在只有4個電腦) – 2015-03-24 23:31:37

+0

可能重複[如何從MSBuild目標多個版本的.NET Framework?](http://stackoverflow.com/questions/2923181/how-to-target -multiple-versions-net-framework-from-msbuild) – 2015-03-24 23:35:37

回答

0

Version Compatibility in the .NET Framework 你應該看看這個。 如果您的應用程序未使用.net的某些特定未來版本,則此版本不同,您不需要3個版本。

+0

我應該目標,因爲我有2 ddl的一個爲dotnet 4和其他爲2和3.5 – 2015-03-24 23:32:46

+0

你需要添加你的DLL像一個解決方案中的不同項目。並在項目設置框架版本。 – Victor 2015-03-24 23:49:14

相關問題