Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / System.Reflection.Emit / AssemblyBuilder.cs
index 5493215a529e6890d10c94303b8023069a33e479..c73c6ada22b50f7009f5b9cabfbab4b7c4feea89 100644 (file)
@@ -30,6 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Resources;
@@ -265,13 +266,6 @@ namespace System.Reflection.Emit
                        if ((access & COMPILER_ACCESS) != 0)
                                throw new NotImplementedException ("COMPILER_ACCESS is no longer supperted, use a newer mcs.");
 
-#if MOONLIGHT
-                       // only "Run" is supported by Silverlight
-                       // however SMCS requires more than this but runs outside the CoreCLR sandbox
-                       if (SecurityManager.SecurityEnabled && (access != AssemblyBuilderAccess.Run))
-                               throw new ArgumentException ("access");
-#endif
-
                        if (!Enum.IsDefined (typeof (AssemblyBuilderAccess), access))
                                throw new ArgumentException (string.Format (CultureInfo.InvariantCulture,
                                        "Argument value {0} is not valid.", (int) access),
@@ -576,7 +570,7 @@ namespace System.Reflection.Emit
                        if (resourceFileName.Length == 0)
                                throw new ArgumentException ("resourceFileName");
                        if (!File.Exists (resourceFileName) || Directory.Exists (resourceFileName))
-                               throw new FileNotFoundException ("File '" + resourceFileName + "' does not exists or is a directory.");
+                               throw new FileNotFoundException ("File '" + resourceFileName + "' does not exist or is a directory.");
                        if (native_resource != NativeResourceType.None)
                                throw new ArgumentException ("Native resource has already been defined.");
 
@@ -865,7 +859,7 @@ namespace System.Reflection.Emit
                         */
                        if ((entry_point != null) && entry_point.DeclaringType.Module != mainModule) {
                                Type[] paramTypes;
-                               if (entry_point.GetParameters ().Length == 1)
+                               if (entry_point.GetParametersCount () == 1)
                                        paramTypes = new Type [] { typeof (string) };
                                else
                                        paramTypes = Type.EmptyTypes;
@@ -1074,7 +1068,7 @@ namespace System.Reflection.Emit
                        throw new NotImplementedException ();
                }
 
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0
                public override Type GetType (string name, bool throwOnError, bool ignoreCase)
                {
                        if (name == null)
@@ -1197,3 +1191,4 @@ namespace System.Reflection.Emit
 #endif
        }
 }
+#endif