Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting v4.7.1 fails on linux, but succeeds on OSX using the same mono+msbuild versions #2728

Closed
et1975 opened this issue Nov 17, 2017 · 1 comment
Labels

Comments

@et1975
Copy link

et1975 commented Nov 17, 2017

Steps to reproduce

Example of a project sample:

Project file

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
  </PropertyGroup>
  
  <ItemGroup>
    <I Include="**/*.$(Extension)"/>
  </ItemGroup>
  
  <Target Name="Build">
    <Message Text="I: %(I.Identity)"/>
  </Target>
</Project>

Directory contents:
N/A

Command line

msbuild /bl

Expected behavior

Given the same version of mono (5.4.1.6) and the same version of msbuild (15.4.0.0) I expect the build to either succeed in both OSX and Linux (CentOS) environment or fail.

Actual behavior

It succeeds on OSX, but on Linux it fails with:

/usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1138,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

Environment data

  • Linux
    msbuild /version output:
    Microsoft (R) Build Engine version 15.4.0.0 ( Thu Oct 12 16:12:13 UTC 2017) for Mono
    Copyright (C) Microsoft Corporation. All rights reserved.

15.4.0.0

ls -l /usr/lib/mono/xbuild/ExtensionsPath/Microsoft/Microsoft.NET.Build.Extensions/
total 16
-rw-r--r--. 1 root root 2862 Oct 12 12:21 Microsoft.NET.Build.Extensions.ConflictResolution.targets
-rw-r--r--. 1 root root 6695 Oct 12 12:21 Microsoft.NET.Build.Extensions.NETFramework.targets
-rw-r--r--. 1 root root 2231 Oct 12 12:21 Microsoft.NET.Build.Extensions.targets
drwxr-xr-x. 4 root root   26 Oct 12 12:21 net461
drwxr-xr-x. 4 root root   26 Oct 12 12:21 net462
drwxr-xr-x. 4 root root   26 Oct 12 12:21 net47
drwxr-xr-x. 2 root root   16 Nov 16 16:48 net471
drwxr-xr-x. 3 root root   18 Oct 12 12:21 tools
  • OSX

msbuild /version output:
Microsoft (R) Build Engine version 15.4.0.0 (master/f296e67b Wed Oct 18 09:47:05 EDT 2017) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

15.4.0.0

ls -ls /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/xbuild/Microsoft/Microsoft.NET.Build.Extensions/
total 32
 8 -rw-r--r--  1 root  admin  2862 Oct 18 09:49 Microsoft.NET.Build.Extensions.ConflictResolution.targets
16 -rw-r--r--  1 root  admin  6695 Oct 18 09:49 Microsoft.NET.Build.Extensions.NETFramework.targets
 8 -rw-r--r--  1 root  admin  2231 Oct 18 09:49 Microsoft.NET.Build.Extensions.targets
 0 drwxr-xr-x  4 root  admin   128 Oct 18 09:49 net461
 0 drwxr-xr-x  4 root  admin   128 Oct 18 09:49 net462
 0 drwxr-xr-x  4 root  admin   128 Oct 18 09:49 net47
 0 drwxr-xr-x  3 root  admin    96 Oct 18 09:49 net471
 0 drwxr-xr-x  3 root  admin    96 Oct 18 09:49 tools

OS info:

  • Linux
cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
  • OSX:
    High Sierra
@et1975
Copy link
Author

et1975 commented Nov 17, 2017

Ok, I tried export FrameworkPathOverride=/lib/mono/4.5 and the compilation now succeeds on Linux.
I had this environment variable set on my OSX machine to get my other (Core SDK) projects compiling and apparently that's what was letting this project to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants