Bug 29459

Summary: Could not load file or assembly 'System.ServiceModel' or one of its dependencies. The system cannot find the file specified.
Product: [Desktop] Xamarin.Mac Reporter: Denis Davydov <ddavydov>
Component: Library (Xamarin.Mac.dll)Assignee: Chris Hamons <chris.hamons>
Status: VERIFIED FIXED    
Severity: normal CC: ddavydov, masafa, mono-bugs+monomac, Rajneeshk
Priority: Normal    
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Reproduce Service.ServiceModel not found

Description Denis Davydov 2015-04-28 08:33:40 UTC
Xamarin.mac 2.0.0 from beta channel.
All work correctly on Xamarin.Mac 1.2

At start application

class MainClass
	{
		static void Main(string[] args)
		{
			NSApplication.Init();
			NSApplication.Main(args);
}
} 




Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel' or one of its dependencies. The system cannot find the file specified.
File name: 'System.ServiceModel'
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00081] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System/AppDomain.cs:706 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System/AppDomain.cs:674 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
  at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System.Reflection/Assembly.cs:551 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x0001d] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:218 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assembly entry_assembly) [0x0001e] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:200 
  at MonoMac.ObjCRuntime.Runtime.RegisterAssemblies () [0x00006] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:186 
  at MonoMac.AppKit.NSApplication.Init () [0x00022] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/AppKit/NSApplication.cs:58 
  at OS33.Mac.MainClass.Main (System.String[] args) [0x00001] in /Users/alex/Documents/GitRepositories/OS33Mac/TFSRepo/OS33.Mac/OS33App/Main.cs:11 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel' or one of its dependencies. The system cannot find the file specified.
File name: 'System.ServiceModel'
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00081] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System/AppDomain.cs:706 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System/AppDomain.cs:674 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
  at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/corlib/System.Reflection/Assembly.cs:551 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x0001d] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:218 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1 assemblies, System.Reflection.Assembly assembly) [0x00031] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:220 
  at MonoMac.ObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assembly entry_assembly) [0x0001e] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:200 
  at MonoMac.ObjCRuntime.Runtime.RegisterAssemblies () [0x00006] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/ObjCRuntime/Runtime.cs:186 
  at MonoMac.AppKit.NSApplication.Init () [0x00022] in /Users/builder/data/lanes/1503/8a0e7bca/source/maccore/src/AppKit/NSApplication.cs:58 
  at OS33.Mac.MainClass.Main (System.String[] args) [0x00001] in /Users/alex/Documents/GitRepositories/OS33Mac/TFSRepo/OS33.Mac/OS33App/Main.cs:11 





Details;
Xamarin Studio
Version 5.9 (build 431)
Installation UUID: 244a085e-0944-42f2-b501-7ace595af631
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

Apple Developer Tools
Xcode 5.0.1 (3335.6)
Build 5A2034a

Xamarin.Mac
Version: 2.0.0.262 (Business Edition)

Xamarin.iOS
Version: 8.10.0.267 (Starter Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

Xamarin.Android
Version: 5.1.0.115 (Starter Edition)
Android SDK: /Users/alex/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
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

Build Information
Release ID: 509000431
Git revision: 7560726734fc7267de2fa9abed2509968deefaa8
Build date: 2015-04-17 19:25:48-04
Xamarin addins: 2e772c734ab3148054eae7bf8949f340fdeb5e5e

Operating System
Mac OS X 10.9.5
Darwin "trolo" 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2015-04-28 18:21:25 UTC
So I just tested a new application as suggested and I'm not seeing this error. I'm assuming it is something your project. Could you attach an example showing the issue or more information about your problem?
Comment 2 Denis Davydov 2015-04-29 06:20:05 UTC
Created attachment 10952 [details]
Reproduce Service.ServiceModel not found
Comment 3 Denis Davydov 2015-04-29 06:21:19 UTC
I have attached example to reproduce this issue.
Comment 4 Denis Davydov 2015-04-29 06:22:59 UTC
The same code works on Xamarin.Mac 1.2
Comment 5 Denis Davydov 2015-04-30 03:38:23 UTC
The same code works on Xamarin.Mac 1.2
Comment 6 Chris Hamons 2015-05-04 16:19:40 UTC
It appears to affect Classic Xamarin.Mac (XamMac.dll). That is unexpected.

This appears to be related to the mono 3.12 to mono 4.0 update in cycle 5.

Install MonoFramework-MDK-3.12.0.77.macos10.xamarin.x86.pkg - Works
Install MonoFramework-MDK-4.0.0.143.macos10.xamarin.x86.pkg - Fails
Comment 7 Chris Hamons 2015-05-04 16:45:56 UTC
@Denis - Thanks for the repro case. We're digging into this now to get you more info.
Comment 8 Marek Safar 2015-05-05 09:29:28 UTC
Fixed in mono master
Comment 9 Rajneesh Kumar 2015-05-12 09:54:45 UTC
I have checked this issue with the following builds:

Xamarin Studio Version 5.9.2 (build 0)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
Mono 4.1.0 ((detached/690aa51)
GTK+ 2.24.23 (Raleigh theme)
Package version: 401001419
Apple Developer Tools Xcode 6.2 (6776)
Xamarin.Mac Version: 2.0.1.46 (Business Edition)
=== Build Information ===
Release ID: 509020000
Git revision: f97f3598952edca4678fc9fdafffecb68ed24399
Build date: 2015-05-08 11:55:56-04
Xamarin addins: ab18ddff45f507ed74f36c2b65df9aee22e28a56
Operating SystemMac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

I have checked this issue with the attached test sample and able to build and deploy the sample application, and observed that this issue does not exist now. Please refer the screencast below:

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

This issue has been fixed, hence I am closing this issue.

Thanks..!