MetaData.ConvertCodeSourceFileToAssemblyFile Method (String, String, String)


Compiles a specified code source file into a runtime assembly file.

Namespace:   System.Runtime.Remoting.MetadataServices
Assembly:  System.Runtime.Remoting (in System.Runtime.Remoting.dll)

public static void ConvertCodeSourceFileToAssemblyFile(
	string codePath,
	string assemblyPath,
	string strongNameFilename


Type: System.String

The path to the file that contains the source code.

Type: System.String

The location where the new run-time assembly is generated.

Type: System.String

The strong name to compile into the new assembly. Can be String.Empty.

For additional information on strong names, see Strong-Named Assemblies.


If a file with the specified name already exists, it is overwritten.

The following code example demonstrates the use of the ConvertCodeSourceFileToAssemblyFile method to write the schema definition of the specified types to a runtime assembly with the specified name. The CsSource.cs file converted here contains C# source code.

using System;
using System.Runtime.Remoting.MetadataServices;

public class Test
   public static void Main()
      MetaData.ConvertCodeSourceFileToAssemblyFile("CsSource.cs", "testAssm.dll", "");

.NET Framework
Available since 1.1
Return to top