Bug 15212 - In Xamarin.Mac project, missing namespace from referenced .dll (Objective-C binding)
Summary: In Xamarin.Mac project, missing namespace from referenced .dll (Objective-C b...
Status: RESOLVED NORESPONSE
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: 1.6.9
Hardware: PC Mac OS
: High normal
Target Milestone: 2.0.x
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2013-10-04 14:49 UTC by Jon Goldberger [MSFT]
Modified: 2015-02-20 17:49 UTC (History)
3 users (show)

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


Attachments
Test Project (22.03 KB, application/zip)
2013-10-04 14:49 UTC, Jon Goldberger [MSFT]
Details
Bindings Test VS (2.16 KB, application/zip)
2013-10-04 14:50 UTC, Jon Goldberger [MSFT]
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 Developer Community or GitHub 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:
RESOLVED NORESPONSE

Description Jon Goldberger [MSFT] 2013-10-04 14:49:56 UTC
Created attachment 5063 [details]
Test Project

We believe there are a few issues. We can start with the easier part of this problem. Also, at the end of this e-mail is the Xamarin Studio version information, etc.


1. Attached is a project/solution that we open inside Xamarin Studio. There is one project “XamMacTest” and it consumes the DLL from the TestBindings Class Library project.

2. We build TestBindings using Visual Studio 2012, then we copy the DLL into the XamMacTest folder and use that. We do not link directly to the project, only the copied DLL which we built using VS2012.

3. You will notice 2 .cs files inside the Class Library, each with a different namespace.

4. Inside the XamMacTest project, we can use the first namespace:
using TestClassLibary;
that seems to work.

5. However if we try to do this:
using Test.Othernamespace;
this name space does not show up.

6. If we try the same thing inside VS2012, a project that consumes TestBindings.dll, then both namespaces show up and we have access to all of the classes.

In some cases, the “using” will be red, inside Xamarin Studio, but it will compile successfully. In other cases it will not compile.

(Update: I wrote this e-mail a month ago, since then we have updated XCode and Xamarin to the latest, but the issues still remain)

Any help in this situation would be great. Additionally, these issues seem to get even worse when protecting our code using SmartAssembly for obfuscation. If we select an older Mono runtime it works, but the newer won’t even compile. Although using the same DLL in VS2012 works fine. There must have been an introduced issue with the newer Mono runtime that makes it less compatible than the older Mono runtime versions.
============================================================================================
Version info:

=== Xamarin Studio ===

Version 4.0.12 (build 3)
Installation UUID: 9d27b6af-805f-4e3c-bf85-d6c57283f99d
Runtime:
Mono 3.2.0 ((no/7c7fcc7)
GTK 2.24.20
GTK# (2.12.0.0)
Package version: 302000000

=== Apple Developer Tools ===

Xcode 4.6.2 (2067.2)
Build 4H1003

=== Xamarin.iOS ===

Version: 6.4.1.1 (Business Edition)
Hash: 5a0fe54
Branch:
Build date: 2013-30-07 08:24:03-0400

=== Xamarin.Mac ===

Xamarin.Mac: 1.4.8

=== Xamarin.Android ===

Version: 4.8.1 (Business Edition)
Android SDK: /Users/nilslahr/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
Java SDK: /usr
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

=== Build Information ===

Release ID: 400120003
Git revision: 593d7acb1cb78ceeeb482d5133cf1fe514467e39
Build date: 2013-08-07 20:30:53+0000
Xamarin addins: 25a0858b281923e666b09259ad4746b774e0a873

=== Operating System ===

Mac OS X 10.8.3
Darwin Nilss-Mac-mini.local 12.3.0 Darwin Kernel Version 12.3.0
Sun Jan 6 22:37:10 PST 2013
root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
Comment 2 Jon Goldberger [MSFT] 2013-10-04 14:50:47 UTC
Created attachment 5064 [details]
Bindings Test VS
Comment 3 Lars 2014-08-11 20:59:53 UTC
We have had the same issue for the last 2-3 years.  The explanation is identical to the above, and now that we are moving to .NET 4.5, this is no longer an annoying issue, but a critical bug and a huge show stopper in us being able to build and sell our product.  We are a licensed user with 5 licenses to Android, 5 for iOS and 2 for .Mac, so we pay a LOT.  We thought this issue would be solved in the last 3 years, so we kept a single laptop with older bits on it that would work, specifically MonoDeveloper using Runtime 2.10.12.  This links and works, even with SmartAssembly obfuscated code, so clearly that runtime was more standards compliant.

Again, we thought this would be fixed, but as of today, after downloading all of the updates, it still does not work.  Ours now is worse.  It used to compile but not run using a newer runtime, but now the compiler says "Internal Compiler Error".

We can click on the library in the references and browse its contents, so clearly the information is there, it just can't somehow be linked properly.

We would like this issue to be raised to critical and updates / information if it has been solved to us ASAP.
Comment 4 Chris Hamons 2014-12-03 16:29:52 UTC
Hello,

My name is Chris Hamons and I'm the lead of Xamarin.Mac.

Sorry for the delay in responding to this bug. In general, if you have a license (as you do), you should contact support via http://support.xamarin.com with concern, especially if they are blocking you.

I'm having difficulty discerning exactly what your issue is. I was able to open up XamMacTest, and do the following with the types in the library:

		static void Main (string[] args)
		{
			Type t = typeof (TestClassLibrary.HelloWorld);
			Type x = typeof (Test.Othernamespace.Class2);
			var a = new Test.Othernamespace.Class2 ();
			a.Test ();
			var b = new TestClassLibrary.HelloWorld ();
			b.Test ();
			NSApplication.Init ();
			NSApplication.Main (args);

		}

Please update the bug with exactly what the problem you are running into is.
Comment 5 Chris Hamons 2015-02-20 17:49:48 UTC
Since it has been over two months with no reply, I'm going to resolve this question as answered. Please feel free to reopen with details or file another bug.