Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / System.Reflection.Emit / AssemblyBuilder.cs
index ab3cda5d83eb9d6ac2e2855284a322fdaea391a5..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;
@@ -69,12 +70,14 @@ namespace System.Reflection.Emit
        }
 
        internal struct MonoResource {
+#pragma warning disable 649
                public byte[] data;
                public string name;
                public string filename;
                public ResourceAttributes attrs;
                public int offset;
                public Stream stream;
+#pragma warning restore 649
        }
 
        internal struct MonoWin32Resource {
@@ -263,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),
@@ -574,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.");
 
@@ -863,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;
@@ -1072,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)
@@ -1195,3 +1191,4 @@ namespace System.Reflection.Emit
 #endif
        }
 }
+#endif