Bug 24596 - [XamarinVS 3.8.143] Could not locate the assembly "monotouch" in some iOS samples
Summary: [XamarinVS 3.8.143] Could not locate the assembly "monotouch" in some iOS sam...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.9
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-17 18:01 UTC by Christopher Blackman
Modified: 2014-12-31 09:55 UTC (History)
5 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Christopher Blackman 2014-11-17 18:01:45 UTC
I am unable to build the iOS samples AudioGenerator and AudioConverterFileConverter using Visual Studio 2013 Update 3. For some reason the reference to monotouch cannot be resolved, and the project fails to build with the following error:

C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "monotouch". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Here is the complete build log: https://gist.github.com/ChrisBlackman/2352a42e8411c67fabf5

The .csproj files of the projects seem to be set up correctly, referencing monotouch using '<Reference Include="monotouch" />' which I believe is the right way to do it. Other projects referencing monotouch in this way are working.

I am using Xamarin VS 3.0.143 in Visual Studio 2013 Update 3 on Windows 8.1, with Xamarin.iOS 8.4.0.0.

The samples AudioGenerator and AudioConverterFileConverter are in the monotouch-samples repository, but I've included them in this Dropbox folder for convenience: https://www.dropbox.com/sh/1v779bcnwi9fxdc/AAB7kpSJicRfqMkl_IEBpcQja?dl=0
Comment 1 Brad Moore 2014-12-21 00:44:15 UTC
A fix I found for this was to remove this line from the .csproj file

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

but keep this one in there.

<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />

This only happens to me with projects created on OSX which I then later checkout a git/svn repo and build on Windows. No idea what *.CSharp.targets actually are either.
Comment 2 Danish Akhtar 2014-12-31 09:55:37 UTC
Today, I have checked this issue with:
VS 2013
XVS 3.9.230
X.iOS 8.6.0.45
Xcode 5.1

Now this issue is not exists, we are successfully able to run build the iOS samples AudioGenerator and AudioConverterFileConverter through VS.

Hence closing this issue.