Re: run time compilation
От: mrozov  
Дата: 21.06.07 13:51
Оценка:
Здравствуйте, fyn85, Вы писали:

F>Выдаеться ошибка :

F>The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

F>Причем System.IO хавает, как заставить его скушать System.Data, как добавлять в таком случае reference?

F>Зврвнее благодарен.

Ну прямо в MSDN-е же пример:

    CompilerParameters cp = new CompilerParameters();

    // Generate an executable instead of 
    // a class library.
    cp.GenerateExecutable = true;

    // Set the assembly file name to generate.
    cp.OutputAssembly = exeFile;

    // Generate debug information.
    cp.IncludeDebugInformation = true;

    // Add an assembly reference.
    cp.ReferencedAssemblies.Add( "System.dll" );
    // Save the assembly as a physical file.
    cp.GenerateInMemory = false;

    // Set the level at which the compiler 
    // should start displaying warnings.
    cp.WarningLevel = 3;

    // Set whether to treat all warnings as errors.
    cp.TreatWarningsAsErrors = false;
    
    // Set compiler argument to optimize output.
    cp.CompilerOptions = "/optimize";
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.