Bug 54653 - The type of namespace "Polly" could not be found. Inteliisense working properly in "Polly" namespace
Summary: The type of namespace "Polly" could not be found. Inteliisense working proper...
Status: VERIFIED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: msbuild ()
Version: 5.0 (2017-02)
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.2
Assignee: Ankit Jain
URL:
Depends on:
Blocks:
 
Reported: 2017-04-06 17:19 UTC by Ethan Dennis
Modified: 2017-05-09 14:14 UTC (History)
4 users (show)

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


Attachments
Repro Sample (5.78 KB, application/zip)
2017-04-06 17:19 UTC, Ethan Dennis
Details
Logs (21.09 KB, text/plain)
2017-05-09 07:42 UTC, Alok Kulkarni
Details


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 GitHub or 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 Ethan Dennis 2017-04-06 17:19:35 UTC
Created attachment 21276 [details]
Repro Sample

I am creating a library that uses the package: Polly. Intellisense works properly on all of the namespace members, but a build error occurs:"The type of namespace 'Polly' could not be found. Are you missing an assembly reference?"

This build error does not occur in Xamarin Studio, only in VS Mac.

Sample project attached.

VS Mac Info:
=== Visual Studio for Mac Preview ===

Version Preview 5 (7.0 build 1659)
Installation UUID: 36300a84-8506-4375-bf56-3e4bc4a984b5
Runtime:
	Mono 4.8.0 (mono-4.8.0-branch/9d74414) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000524

=== NuGet ===

Version: 4.0.0.2323

=== Xamarin.Profiler ===

Version: 1.4.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3 (12169)
Build 8E162

=== Xamarin.iOS ===

Version: 10.8.0.175 (Visual Studio Enterprise)
Hash: a04678c2
Branch: d15-1
Build date: 2017-03-28 14:05:38-0400

=== Xamarin.Android ===

Version: 7.2.0.7 (Visual Studio Enterprise)
Android SDK: /Users/ethand/Library/Developer/Xamarin/android-sdk-macosx
	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)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.2.0.175 (Visual Studio Enterprise)

=== Xamarin Inspector ===

Version: 1.2.0
Hash: 62c17e6
Branch: d15-1
Build date: Mon, 20 Mar 2017 02:36:23 GMT

=== Build Information ===

Release ID: 700001659
Git revision: c3bcd7708b7762fa4c12a88e7c5d75d83eb6462b
Build date: 2017-03-14 22:27:06-04
Xamarin addins: 11612bcfed8942216a2991a15e28b8d3df21449a
Build lane: monodevelop-lion-vs-mac-preview5

=== Operating System ===

Mac OS X 10.12.3
Darwin ethand-mac.local 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
Comment 1 Matt Ward 2017-04-07 12:03:02 UTC
This looks like an msbuild problem. If you switch to using xbuild, which is what Xamarin Studio is using, then it works. So a workaround is to go into preferences - Projects - Build and uncheck Build with MSBuild instead of xbuild.

Running msbuild from the command line it looks like the Polly.dll is not passed as a /reference parameter to csc.exe whilst it is passed if you use xbuild. MSBuild diagnostic output below using MSBuild with mono 5.0.0.34 (2017-02/71cc0a1 Fri Mar 31 06:20:38 EDT 2017)

https://gist.github.com/mrward/0bdcd998b8ce958ec4c2386c56fdf9e1
Comment 2 Ethan Dennis 2017-04-07 13:28:12 UTC
If I switch to using xbuild in VS Mac I get the following errors:


Building: PollySample (Debug)
Performing main compilation…
/Library/Frameworks/Mono.framework/Versions/5.0.0/bin/mcs /noconfig "/r:/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/mscorlib.dll" -nostdlib "/out:/Users/ethand/Desktop/PollySample/PollySample/bin/Debug/PollySample.dll" "/r:/Users/ethand/Desktop/PollySample/packages/System.Runtime.InteropServices.RuntimeInformation.4.3.0/lib/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll" "/r:/Users/ethand/Desktop/PollySample/packages/Polly.5.0.6/lib/netstandard1.0/Polly.dll" "/r:/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG"  /t:library "/Users/ethand/Desktop/PollySample/PollySample/PollyUsage.cs" "/Users/ethand/Desktop/PollySample/PollySample/Properties/AssemblyInfo.cs" 
Compilation failed: 31 error(s), 0 warnings

error CS0518: The predefined type `System.Object' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.ValueType' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Attribute' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Int32' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.UInt32' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Int64' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.UInt64' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Single' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Double' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Char' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Int16' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Decimal' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Boolean' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.SByte' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Byte' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.UInt16' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.String' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Enum' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Delegate' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.MulticastDelegate' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Void' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Array' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Type' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Collections.IEnumerator' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Collections.IEnumerable' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.IDisposable' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.IntPtr' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.UIntPtr' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.RuntimeFieldHandle' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.RuntimeTypeHandle' is defined in an assembly that is not referenced.
error CS0518: The predefined type `System.Exception' is defined in an assembly that is not referenced.


Build complete -- 31 errors, 0 warnings

---------------------- Done ----------------------

Build: 31 errors, 0 warnings
Comment 3 Matt Ward 2017-04-07 13:39:49 UTC
That looks like you unchecked the "Use MSBuild engine" in project options which will switch the build to use mcs. I get the same error if I do that.

Instead you should check that option and then go into global preferences (from the main Xamarin Studio or Visual Studio for Mac menu) and uncheck Build with MSBuild instead of xbuild. Then close and re-load the solution.
Comment 4 Ethan Dennis 2017-04-07 13:43:42 UTC
That worked. Thanks!
Comment 7 Ankit Jain 2017-04-15 08:25:59 UTC
Fixes merged.
Comment 8 Alok Kulkarni 2017-05-09 07:42:49 UTC
Created attachment 22020 [details]
Logs

Verified on build VsFM Preview 10 (7.0 Build 3116)

Build info : https://gist.github.com/anonymous/a7f1863c8fc73b5173ea6257a1801cf6

Hence marking verified fixed.
Comment 9 Alok Kulkarni 2017-05-09 07:52:40 UTC
Hi @Ethan Dennis, as I haven't rights to mark Verified this bug. will you please mark this bug as verified fixed?