This documentation is archived and is not being maintained.

MetaData::ConvertCodeSourceFileToAssemblyFile Method

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
)

Parameters

codePath
Type: System::String
The path to the file that contains the source code.
assemblyPath
Type: System::String
The location where the new run-time assembly is generated.
strongNameFilename
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.

NoteNote

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.dll>
#using <system.runtime.remoting.dll>

using namespace System;
using namespace System::Runtime::Remoting::MetadataServices;
int main()
{
   MetaData::ConvertCodeSourceFileToAssemblyFile( "CsSource.cs", "testAssm.dll", "" );
   return 0;
}



.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: