Bug 20019 - Visual Studio not recognizing native library
Summary: Visual Studio not recognizing native library
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.12.x
Hardware: PC Mac OS
: Normal normal
Target Milestone: 4.1.0 (C7)
Assignee: vsx
Depends on:
Reported: 2014-05-23 15:14 UTC by Allie Miller
Modified: 2016-05-19 18:48 UTC (History)
10 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Allie Miller 2014-05-23 15:14:02 UTC
*Reported on behalf of a user*

The Problem
If a Xamarin.iOS project contains a reference to a native library, the following build output error appears:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3102,5): error MSB3174: Invalid value for 'TargetFrameworkVersion'.
Project not selected to build for this solution configuration

However, the configuration is set in the Configuration Manager for the project as shown here: http://screencast.com/t/dJC7wmfH

In Xamarin Studio, the same project with the reference to the native library builds successfully.

Steps to Reproduce
1) In Visual Studio, please open the attached test project
2) Attempt to compile the project after adjusting the additional mtouch arguments to your specific directory to link the library.

The project should build successfully.

Actual Results
The project fails to build successfully in Visual Studio. Builds fine in Xamarin Studio.

Versioning Information
On Mac:
=== Xamarin Studio ===
Version 4.2.5 (build 0)
=== Apple Developer Tools ===
Xcode 5.1.1
=== Xamarin.iOS ===
=== Xamarin.Android ===
Version: 4.12.3 
=== Operating System ===
Mac OS X 10.9.3

On Windows:
Visual Studio 2013
Xamarin for VS
Comment 2 Ram Chandra 2014-05-27 06:59:38 UTC
I have tried to reproduce this issue and I am able to reproduce this issue.

Steps to reproduce:
1. Open the attached project in VS2013.
2. Build and debug the attached project.

I observed that when I build the attached project on "Mac machine", the solution is build and deployed successfully but when I run the same project on "visual studio" I am getting the a build error i.e.  "Invalid value for 'TargetFrameworkVersion.' "

Screencast: http://www.screencast.com/t/qs6c9Evoij

Build output log: https://gist.github.com/saurabh360/695e964e4934e5ae13cc

Envrionment Info:

Windows 7
Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.50938
Xamarin for Visual Studio (b3acb09afda91828e5bd48308ac8e7433d30f330)
Xamarin.iOS (b3acb09afda91828e5bd48308ac8e7433d30f330)
Comment 9 Naqeeb 2016-05-19 18:48:27 UTC
I have checked this with sample given in comment 8 and observed that it is working fine. I am able to successfully without any error. Here is the screencast for the same: http://www.screencast.com/t/db6L0eGZxGS

Hence closing this issue.

Environment info: https://gist.github.com/Udham1/37e7376150a17d67f009ff9889882c6a