Forum Visual Studio

Unregistered TargetFramework '.NETFramework,Version=v4.5.1' is being requested from ...

NinaKharchenkoNinaKharchenko RUMember
edited March 2016 in Visual Studio

I'm trying to resolve build failed error.
Build output (with Detailed verbosity) contains only

Build failed.
Build: 1 error, 0 warnings

IDE logs (Help > Open log directory):

WARNING [2016-03-02 10:18:43Z]: Unregistered TargetFramework '.NETFramework,Version=v4.5.1' is being requested from SystemAssemblyService, returning empty TargetFramework
ERROR [2016-03-02 10:18:43Z]: Error running resgen
System.InvalidOperationException: No compatible framework found for assembly 'C:\Program Files (x86)\Xamarin Studio\bin\MSBuild\dotnet.14.0\MonoDevelop.Projects.Formats.MSBuild.exe' (required framework: .NETFramework,Version=v4.5.1)
...

XS reinstall and Microsoft Build Tools 2015 reinstall doesn't solve the problem.

IDE info:
Xamarin Studio
Version 6.0 (build 4520)
Installation UUID: 98271cc1-03e0-4f37-8c06-ac3c4d6afefe
Runtime:
Microsoft .NET 4.0.30319.42000
GTK+ 2.24.25 (Dark theme)
GTK# 2.12.30.1

Xamarin.Profiler
Version: 0.24.0.0
Location: C:\Program Files (x86)\Xamarin\Profiler\XamarinProfiler.exe

Xamarin.Android
Version: 6.0.99.544 (Business Edition)
Android SDK: C:\Users\anemtsev\AppData\Local\Android\android-sdk
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.1

Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

Xamarin Android Player
Version: 0.5.6
Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe

Build Information
Release ID: 600004520
Git revision: a354b2cb9df4b96f50b0ccb960dbdd5a9155510c
Build date: 2016-02-18 15:14:28-05
Xamarin addins: 8e54979f23feee160d245a3c33e43e77779b1eb4
Build lane: monodevelop-windows-master

Operating System
Windows 6.1.7601.65536 (64-bit)

Best Answer

Answers

  • mattwardmattward GBMember Xamurai

    Do you have .NET 4.5.1 installed?

  • NinaKharchenkoNinaKharchenko RUMember
    edited March 2016

    According to

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Release = 0x6041f

    .NET Framework 4.6.1 is installed.

    Microsoft .NET Framework 4.5.1 (Offline Installer) reports that .NET Framework 4.5.1 or later version is already installed.

    .NET Framework Setup Verification Utility reports:
    [03/02/16,14:22:32] Detected operating system: Windows 7 (x64)
    [03/02/16,14:22:32] Windows directory: C:\Windows
    [03/02/16,14:22:32] System directory: C:\Windows\system32
    [03/02/16,14:22:32] Program Files directory: C:\Program Files (x86)
    [03/02/16,14:22:32] Common Files directory: C:\Program Files (x86)\Common Files
    [03/02/16,14:22:32] Install state for .NET Framework 1.0: not installed.
    [03/02/16,14:22:32] Install state for .NET Framework 1.1: not installed.
    [03/02/16,14:22:32] Install state for .NET Framework 2.0: installed with service pack 2.
    [03/02/16,14:22:32] Install state for .NET Framework 3.0: installed with service pack 2.
    [03/02/16,14:22:32] Install state for .NET Framework 3.5: installed with service pack 1.
    [03/02/16,14:22:32] Install state for .NET Framework 4 Client: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4 Full: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4.5: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4.5.1: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4.5.2: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4.6: installed with no service packs.
    [03/02/16,14:22:32] Install state for .NET Framework 4.6.1: installed with no service packs.
    [03/02/16,14:22:32] Not adding product '.NET Framework 1.0' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 1.1' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 1.1 SP1' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 2.0' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 2.0 SP1' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 3.0' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 3.0 SP1' because it is not currently installed
    [03/02/16,14:22:32] Not adding product '.NET Framework 3.5' because it is not currently installed

  • mattwardmattward GBMember Xamurai

    Can you create a C# console project, target .NET 4.5.1, and then build it from the command line with msbuild?

  • NinaKharchenkoNinaKharchenko RUMember
    edited March 2016

    "Hello World" console project targeted at "Mono / .NET 4.5"

    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

    were successfully build from command line with
    C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe

    mscorlib.dll at output dir have version 4.0.30319.18408

    More info about Build error from ide logs:
    ERROR [2016-03-02 15:41:17Z]: Build failed.
    System.InvalidOperationException: No compatible framework found for assembly 'C:\Program Files (x86)\Xamarin Studio\bin\MSBuild\dotnet.14.0\MonoDevelop.Projects.Formats.MSBuild.exe' (required framework: .NETFramework,Version=v4.5.1)
    at MonoDevelop.Core.Assemblies.TargetRuntime.ExecuteAssembly(ProcessStartInfo pinfo, TargetFramework fx) in C:\Users\builder\data\lanes\88\a354b2cb\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Core.Assemblies\TargetRuntime.cs:line 246
    at MonoDevelop.Projects.MSBuild.MSBuildProjectService.<>c__DisplayClass81_1.b__0() in C:\Users\builder\data\lanes\88\a354b2cb\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects.MSBuild\MSBuildProjectService.cs:line 990
    at System.Threading.Tasks.Task`1.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()

  • mattwardmattward GBMember Xamurai

    Try v4.5.1 in your console project and compile that using msbuild from the command line.

  • NinaKharchenkoNinaKharchenko RUMember
    edited March 2016

    Build test project from commandline with

    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>

    aslo succeded (mscorlib.dll version 4.6.1055.0).

    For the same test project Xamarin Studio shows (Build > General):

    Target framework: .NETFramework 4.5.1 (Not installed)

    PS
    These instructions doesn't help Xamarin Studio to found .NET 4.5.1:
    http://lastexitcode.com/blog/2014/11/16/InstallingPortableClassLibrariesForXamarinStudio/

Sign In or Register to comment.