Skip to content

Commit

Permalink
[xbuild] Fix building with 2.0 toolset
Browse files Browse the repository at this point in the history
BXC18794 - Error executing task Csc with 2.0 toolset since Mono 3.4.0
  • Loading branch information
mhutch committed Apr 3, 2014
1 parent 8ffc407 commit 2086958
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Expand Up @@ -55,6 +55,7 @@ public override bool Execute ()
}
}

#if NET_3_5
[Output]
public string FrameworkVersion11Path {
get {
Expand Down Expand Up @@ -86,6 +87,7 @@ public override bool Execute ()
TargetDotNetFrameworkVersion.Version35);
}
}
#endif

#if NET_4_0
[Output]
Expand Down
Expand Up @@ -40,8 +40,10 @@ enum TargetDotNetFrameworkVersion
{
Version11,
Version20,
#if NET_3_5

This comment has been minimized.

Copy link
@BrandonLWhite

BrandonLWhite Apr 4, 2014

Contributor

I'm pretty sure the broken build is due to this exclusion of these enum fields

Version30,
Version35,
#endif
#if NET_4_0
Version40,
#endif
Expand All @@ -58,8 +60,10 @@ enum TargetDotNetFrameworkVersion
VersionLatest = Version45
#elif NET_4_0
VersionLatest = Version40
#else
#elif NET_3_5
VersionLatest = Version35
#else
VersionLatest = Version20
#endif
}
}
12 changes: 3 additions & 9 deletions mcs/tools/xbuild/data/2.0/Microsoft.Common.targets
Expand Up @@ -110,22 +110,16 @@
</PropertyGroup>
<Target Name="GetFrameworkPaths" DependsOnTargets="$(GetFrameworkPathsDependsOn)">
<GetFrameworkPath>
<Output Condition="'$(TargetFrameworkVersion)' == 'v3.5'"
TaskParameter="FrameworkVersion35Path"
ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
<Output Condition="'$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
TaskParameter="FrameworkVersion30Path"
ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
<Output Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'"
TaskParameter="FrameworkVersion20Path"
<Output
TaskParameter="Path"
ItemName="_CombinedTargetFrameworkDirectoriesItem"/>
</GetFrameworkPath>
<CreateProperty Value="@(_CombinedTargetFrameworkDirectoriesItem)">
<Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/>
</CreateProperty>

<Warning Text="TargetFrameworkVersion '$(TargetFrameworkVersion)' not supported by this toolset (ToolsVersion: $(MSBuildToolsVersion))."
Condition="'$(TargetFrameworkVersion)' != 'v3.5' and '$(TargetFrameworkVersion)' != 'v3.0' and '$(TargetFrameworkVersion)' != 'v2.0'"/>
Condition="'$(TargetFrameworkVersion)' != 'v2.0'"/>
</Target>

<PropertyGroup>
Expand Down

4 comments on commit 2086958

@BrandonLWhite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this has broken the build for me:

MCS [net_2_0] Microsoft.Build.Engine.dll
Microsoft.Build.BuildEngine/Engine.cs(114,81): error CS0117: Microsoft.Build.Utilities.TargetDotNetFrameworkVersion' does not contain a definition forVersion30'
/root/my-mono-fork/mcs/class/Microsoft.Build.Engine/./../../class/lib/net_2_0/Microsoft.Build.Utilities.dll (Location of the symbol related to previous error)
Microsoft.Build.BuildEngine/Engine.cs(116,81): error CS0117: Microsoft.Build.Utilities.TargetDotNetFrameworkVersion' does not contain a definition forVersion35'
/root/my-mono-fork/mcs/class/Microsoft.Build.Engine/./../../class/lib/net_2_0/Microsoft.Build.Utilities.dll (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings

I'm in the process of confirming that it's due to this exact commit. I'll report back. Please let me know if you need any additional information.

@BrandonLWhite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that it is indeed this commit. It fails to build on both Ubuntu-Precise/x64 and Debian-Wheezy/armel using mono 3.4.1.

@xplicit
Copy link
Contributor

@xplicit xplicit commented on 2086958 Apr 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing, the build does not compile on Linux.

@vargaz
Copy link
Contributor

@vargaz vargaz commented on 2086958 Apr 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was reverted until it gets fixed.

Please sign in to comment.