MetaData.ConvertCodeSourceFileToAssemblyFile(String, String, String) Méthode

Définition

Compile un fichier source de code spécifié en un fichier d'assembly de Runtime.

public:
 static void ConvertCodeSourceFileToAssemblyFile(System::String ^ codePath, System::String ^ assemblyPath, System::String ^ strongNameFilename);
public static void ConvertCodeSourceFileToAssemblyFile (string codePath, string assemblyPath, string strongNameFilename);
static member ConvertCodeSourceFileToAssemblyFile : string * string * string -> unit
Public Shared Sub ConvertCodeSourceFileToAssemblyFile (codePath As String, assemblyPath As String, strongNameFilename As String)

Paramètres

codePath
String

Chemin d'accès au fichier contenant le code source.

assemblyPath
String

Emplacement où le nouvel assembly du Runtime est généré.

strongNameFilename
String

Nom fort sous lequel compiler le nouvel assembly. Peut être Empty.

Exemples

L’exemple de code suivant illustre l’utilisation de la ConvertCodeSourceFileToAssemblyFile méthode pour écrire la définition de schéma des types spécifiés dans un assembly runtime portant le nom spécifié. Le CsSource.cs fichier converti ici contient du code source C#.

#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;
}
using System;
using System.Runtime.Remoting.MetadataServices;

public class Test
{
   public static void Main()
   {
      MetaData.ConvertCodeSourceFileToAssemblyFile("CsSource.cs", "testAssm.dll", "");
   }
}
Imports System.Runtime.Remoting.MetadataServices


Public Class Test
   
   Public Shared Sub Main()
      MetaData.ConvertCodeSourceFileToAssemblyFile("CsSource.cs", "testAssm.dll", "")
   End Sub
End Class

Remarques

Pour plus d’informations sur les noms forts, consultez Assemblys à nom fort.

Notes

Si un fichier portant le nom spécifié existe déjà, il est remplacé.

S’applique à