Bug 30621 - Project including PCL is cannot compile with Indie license, with showing "System.ServiceModel" error
Summary: Project including PCL is cannot compile with Indie license, with showing "Sys...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.10
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 8.13 (C6 alpha)
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2015-05-30 19:29 UTC by kochizufan
Modified: 2015-09-21 10:54 UTC (History)
4 users (show)

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


Attachments
Failing Test Case (2.90 MB, application/zip)
2015-06-02 03:31 UTC, kochizufan
Details
BruTile's Error Sample (2.29 MB, application/zip)
2015-06-05 05:39 UTC, kochizufan
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 FIXED

Description kochizufan 2015-05-30 19:29:10 UTC
https://bugzilla.xamarin.com/show_bug.cgi?id=18664
This bug should be reopen again.

Steps to reproduce this issue:

1.Downloading some project which is using PCL libraries.
Like,
https://github.com/pauldendulk/Mapsui
https://github.com/OsmSharp/OsmSharp.Samples

2.Compiling them by Xamarin Studio with Indie license.

3.These sample not using System.ServiceModel, but they cannot compile with errors like:
Error MT9006: Using type `System.ServiceModel.EndpointAddress10` requires Business (or higher) license. (MT9006)

Environment:
=== Xamarin Studio ===

Version 5.9.1 (build 3)
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

=== Xamarin.Android ===

Version: 5.1.1.0 (Indie Edition)
Android SDK: /adt-bundle-mac/sdk
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: 8.10.0.303 (Indie Edition)
Hash: 3c4e832
Branch: master
Build date: 2015-05-20 21:47:57-0400

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f

=== Operating System ===

Mac OS X 10.10.3
Darwin ootsuka-no-MacBook-Air.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 kochizufan 2015-06-01 15:12:04 UTC
More easier way to reproduce:

* Make new solution at Xamarin Studio.
* Make iOS and Android projects under the solution.
* Clone https://github.com/BruTile/BruTile.git from github. It is not using System.ServiceModel, I grepped.
* Add BruTile project to the solution, and refer it from iOS and Android project.
* Add dummy code
```
var web = new BruTile.Web.HttpTileSource (new BruTile.TileSchema (), new BruTile.Web.OsmRequest ());
```
to iOS project's AppDelegate#FinishedLaunching and Android project's MainActivity#OnCreate.
* Compile them. iOS project shows "Need Business edition" error, Android not.

iOS's error shows,

```
Error MT9006: Using type `System.ServiceModel.EndpointAddress10` requires Business (or higher) license.
Error MT9006: Using type `System.ServiceModel.EndpointAddress` requires Business (or higher) license.
Error MT9006: Using type `System.ServiceModel.EndpointIdentity` requires Business (or higher) license.
```

Isn't it a bug?
Comment 2 kochizufan 2015-06-02 03:30:17 UTC
This is absolutely reopening of https://bugzilla.xamarin.com/show_bug.cgi?id=18664 .
Because I downloaded Failing Test Case of 18664 and build it by Indie license, then errors are shown:

```
Compiling to native code
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/kotsuka/Downloads/ServiceStackPCLTest/ServiceStackPCLTest/obj/iPhone/Debug/mtouch-cache" --executable "ServiceStackPCLTest" --nomanifest --nosign -dev "/Users/kotsuka/Downloads/ServiceStackPCLTest/ServiceStackPCLTest/bin/iPhone/Debug/ServiceStackPCLTest.app" -r "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/System.dll" -r "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/System.Xml.dll" -r "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/System.Core.dll" -r "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/monotouch.dll" -r "/Users/kotsuka/Downloads/ServiceStackPCLTest/packages/ServiceStack.Interfaces.Pcl.4.0.15/lib/portable-wp80+sl5+net45+win8+monotouch+monoandroid/ServiceStack.Interfaces.dll" -r "/Users/kotsuka/Downloads/ServiceStackPCLTest/packages/ServiceStack.Text.Pcl.4.0.15/lib/portable-net45+win8+monotouch+monoandroid/ServiceStack.Text.dll" -r "/Users/kotsuka/Downloads/ServiceStackPCLTest/packages/ServiceStack.Client.Pcl.4.0.15/lib/MonoTouch/ServiceStack.Client.dll" -r "/Users/kotsuka/Downloads/ServiceStackPCLTest/packages/ServiceStack.Client.Pcl.4.0.15/lib/MonoTouch/ServiceStack.Pcl.iOS.dll" -debug -linksdkonly -sdk "8.2" -targetver "7.0" --abi=armv7 "/Users/kotsuka/Downloads/ServiceStackPCLTest/ServiceStackPCLTest/bin/iPhone/Debug/ServiceStackPCLTest.exe"
Xamarin.iOS 8.10.0 Indie Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk
error MT9006: Using type `System.ServiceModel.ICommunicationObject` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ClientBase`1` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ExceptionDetail` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.InstanceContext` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ServiceContractAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.IDefaultCommunicationTimeouts` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.EndpointAddress` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.OperationContractAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.IExtensibleObject`1` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.IContextChannel` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.IClientChannel` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ChannelFactory` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ChannelFactory`1` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.CommunicationState` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.EndpointAddress10` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.CommunicationException` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.CommunicationObjectFaultedException` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.SessionMode` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.SilverlightClientConfigLoader` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.BasicHttpSecurityMode` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.EndpointIdentity` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.HttpBindingBase` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.BasicHttpBinding` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.BasicHttpSecurity` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.EnvelopeVersion` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.DefaultCommunicationTimeouts` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.BasicHttpMessageSecurity` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.HttpTransportSecurity` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.HttpClientCredentialType` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.WSMessageEncoding` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.HostNameComparisonMode` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.TransferMode` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.Constants` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.XmlSerializerFormatAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.DataContractFormatAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ServiceKnownTypeAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.FaultContractAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageParameterAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageContractAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.ProtocolException` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageHeaderException` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageContractMemberAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageHeaderAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessagePropertyAttribute` requires Business (or higher) license.
error MT9006: Using type `System.ServiceModel.MessageBodyMemberAttribute` requires Business (or higher) license.
```

Then I also attach same program of 18664 to reproject this bug.
Comment 3 kochizufan 2015-06-02 03:31:57 UTC
Created attachment 11420 [details]
Failing Test Case
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-06-04 07:34:21 UTC
The initial test case references ServiceStack.Client, which references System.ServiceModel types (from the System.ServiceModel.Primitives assembly).

However those references went away when I updated the packages.

Can you make sure you have the latest packages, and try again?
Comment 5 kochizufan 2015-06-05 00:53:02 UTC
I tried.
As you said, in "Failing Test Case", I change 
* ServiceStack.Client.Pcl
* ServiceStack.Interface
* ServiceStack.Text.Pcl
new ones from NuGet, causing error is stopped.

But, how about BruTile?
https://github.com/BruTile/BruTile.git

BruTile never uses System.ServiceModel (I grepped, and contributor also said never used), and if I compile, Android never show errors, but only iOS shows "Need Business license" error.

If there are any technique to not to compile PCL without references to System.ServiceModel, please open it to us...
We are very confused..
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-06-05 04:20:39 UTC
Can you attach your project that uses BruTile? That makes sure we test the exact same thing.
Comment 7 kochizufan 2015-06-05 05:39:13 UTC
Created attachment 11476 [details]
BruTile's Error Sample

I add Sample project for this bug.
It include both Android and iOS project.

In Android project, it does not show errors, even compiled in Indie license.
But in iOS project, it show license errors if indies. (Not for simulator but for real device)

BruTile never contains references of System.ServiceModel, so I am confusing...
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-06-05 06:05:35 UTC
@Sebastien, can you have a look?

The chain of events goes like this:

> System.ServiceModel.EndPointAddress10 is marked because it has a System.Xml.Serialization attribute.
> Types with System.Xml.Serialization attributes are marked because System.Xml.Serialization.IXmlSerializable is marked
> System.Xml.Serialization.IXmlSerializable is marked because System.Xml.Linq.XElement implements it 
> System.Xml.Linq.XElement is marked because the BruTile project uses Linq.
Comment 9 Sebastien Pouliot 2015-06-05 13:50:54 UTC
Fixed in maccore/head 6465f7ce0dec4503c13c82568360e1e60699d2b1

Once confirmed by QA I'll look at having it backported for 8.10.3.
Comment 10 kochizufan 2015-07-08 01:13:13 UTC
I updated Xamarin Studio to Version 5.9.4 (build 5) and Xamarin.iOS Version: 8.10.3.2 (Indie Edition), but this bug still occured, with same attached program.

Is this fixed in Xamarin.iOS 8.10.3 or later?
Comment 11 Rolf Bjarne Kvinge [MSFT] 2015-07-13 07:38:50 UTC
8.10.3 ended up being an interim release with a few iOS 9 fixes (outside our planned release schedule).

The 8.10.3 release my colleague mentioned in comment 9 is now called 8.10.4 (unless Apple has more surprises waiting for us, requiring another interim release).

However at this point it does not look like we'll be able to get this in 8.10.4 (although I'll try), but it will be in the next major release (8.12).
Comment 12 kochizufan 2015-07-13 12:07:34 UTC
I see.
Thank you for explaining to me!