[Mono-dev] RE: [mono-vb] RE: Microsoft.VisualBasic.VBCodeProvider.CreateCompiler.CompileAssemblyFromSource commandline options

Arnhoffer Károly karnhoffer at ecron.hu
Tue Feb 14 02:57:50 EST 2006


I have to note that the solution I previously adviced is bad (I tried it at my site). Temporarily I have patched for myself as follows (and it is working fine for me):

		static string BuildArgs (CompilerParameters options, string[] fileNames)
		{
			....
			// add standard import to Microsoft.VisualBasic if missing
			if (!Reference2MSVBFound)
				args.AppendFormat ("/r:\"{0}\" ", "Microsoft.VisualBasic");

			args.AppendFormat ("{0}", options.CompilerOptions);

			args.AppendFormat (" -- "); // makes mbas not try to process filenames as options

			foreach (string source in fileNames)
				args.AppendFormat ("\"{0}\" ", source);

			return args.ToString ();
		}

-----Original Message-----
From: Rafael Teixeira [mailto:monoman at gmail.com] 
Sent: Monday, February 13, 2006 8:08 PM
To: Arnhoffer Károly
Cc: mono vb; mono-devel-list at lists.ximian.com
Subject: Re: [mono-vb] RE: Microsoft.VisualBasic.VBCodeProvider.CreateCompiler.CompileAssemblyFromSource commandline options


Looks like it. I'll try to fix it tomorrow.

Thanks for the catch,

On 2/13/06, Arnhoffer Károly <karnhoffer at ecron.hu> wrote:
> As I can see in 
> mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs 
> CompilerParameters.CompilerOptions are never added to the command line 
> arguments. For example BuildArgs now:
>
>                 static string BuildArgs (CompilerParameters options, string[] fileNames)
>                 {
>                         ...
>                         return args.ToString ();
>                 }
>
> But it should be something like this:
>
>                 static string BuildArgs (CompilerParameters options, string[] fileNames)
>                 {
>                         ...
>                         return args.ToString () + options.CompilerOptions;
>                 }
>
> Am I right?
> -----Original Message-----
> From: Arnhoffer Károly
> Sent: Monday, February 13, 2006 9:03 AM
> To: mono vb; mono-devel-list at lists.ximian.com
> Subject: 
> Microsoft.VisualBasic.VBCodeProvider.CreateCompiler.CompileAssemblyFro
> mSource commandline options
>
>
> Hi,
>
> I use 
> Microsoft.VisualBasic.VBCodeProvider.CreateCompiler.CompileAssemblyFro
> mSource to compile a code snippet at runtime. There is a compilation 
> error and first I want to se what the command is that does the 
> compilation. Is it possible to see the full command? With Windows and 
> .Net there is a file (.cmdline) which contains all the parameters that 
> are passed to the vbc.exe. Is there something like this with Mono?
>
> Thanks!
>
> Károly
>
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-vb
>


--
Rafael "Monoman" Teixeira
---------------------------------------
As I'm currently working a lot with Java and even fixing Java VMs
(JamVM/Kaffe) and GNU Classpath code, I think I may partly borrow the title (Javaman) from my friend Bruno Souza and become the MonoNJavaMan. Yeah, I may currently be crazier than usual...



More information about the Mono-devel-list mailing list