// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Resources;
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),
}
*/
+ public static AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access)
+ {
+ if (name == null)
+ throw new ArgumentNullException ("name");
+
+ return new AssemblyBuilder (name, null, access, false);
+ }
+
public ModuleBuilder DefineDynamicModule (string name)
{
return DefineDynamicModule (name, name, false, true);
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.");
internal bool IsRun {
get {
return access == (uint)AssemblyBuilderAccess.Run || access == (uint)AssemblyBuilderAccess.RunAndSave
-#if NET_4_0
|| access == (uint)AssemblyBuilderAccess.RunAndCollect
-#endif
;
}
*/
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;
return (str == "neutral" ? String.Empty : str);
}
- internal override AssemblyName UnprotectedGetName ()
- {
- AssemblyName an = base.UnprotectedGetName ();
- if (sn != null) {
- an.SetPublicKey (sn.PublicKey);
- an.SetPublicKeyToken (sn.PublicKeyToken);
- }
- return an;
- }
-
/*Warning, @typeArguments must be a mscorlib internal array. So make a copy before passing it in*/
internal Type MakeGenericType (Type gtd, Type[] typeArguments)
{
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT || MOBILE
public override Type GetType (string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
public override AssemblyName GetName (bool copiedName)
{
- return base.GetName (copiedName);
+ AssemblyName aname = new AssemblyName ();
+ FillName (this, aname);
+
+ if (sn != null) {
+ aname.SetPublicKey (sn.PublicKey);
+ aname.SetPublicKeyToken (sn.PublicKeyToken);
+ }
+ return aname;
+
}
[MonoTODO ("This always returns an empty array")]
public override string FullName {
get { return base.FullName; }
}
-#endif
}
}
+#endif