Bugzilla – Bug 323741
[Patch]: Compilation of CodeDOM code fails
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by frederik.carlier@ugent.be 2007-03-06 16:37:52 MST ---- Description of Problem: Compilation of CodeDOM code fails. I noticed this when running a VB ASP.NET project, but can provide an easier test case using code coming from MSDN Germany (the first usuable code found by Google) http://www.microsoft.com/germany/msdn/library/net/vbnet/DynamischeCodegenerierungMitVBNET.mspx?mfr=true Steps to reproduce the problem: 1. vbnc codecom.vb 2. mono codedom.exe Actual Results: fcarlier@col-clt-04:~$ mono codedom.exe Unhandled Exception: System.IO.FileNotFoundException: Could not find file "/tmp/2232f265/4013be40.dll". File name: '/tmp/2232f265/4013be40.dll' at System.IO.FileStream..ctor (System.String name, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] at System.IO.FileStream..ctor (System.String name, FileMode mode, FileAccess access, FileShare share) [0x00000] at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) at System.IO.File.OpenRead (System.String path) [0x00000] at Microsoft.VisualBasic.VBCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] at Microsoft.VisualBasic.VBCodeCompiler.CompileFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources) [0x00000] at Microsoft.VisualBasic.VBCodeCompiler.CompileAssemblyFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources) [0x00000] at Microsoft.VisualBasic.VBCodeCompiler.CompileAssemblyFromSource (System.CodeDom.Compiler.CompilerParameters options, System.String source) [0x00000] at Module1.CreateAssemblyFromCode (System.String Code) [0x00000] at Module1.Main () [0x00000] Expected Results: CodeDOM to work How often does this happen? Always Additional Information: SVN Head ---- Additional Comments From frederik.carlier@ugent.be 2007-03-06 16:38:08 MST ---- Created an attachment (id=171610) Source code required to reproduce the issue ---- Additional Comments From frederik.carlier@ugent.be 2007-03-06 17:44:20 MST ---- Created an attachment (id=171611) Proposed fix ---- Additional Comments From frederik.carlier@ugent.be 2007-03-06 17:46:00 MST ---- This particular issue is caused by the fact that the reference to Microsoft.VisualBasic doesn't include the ".dll" suffix. However, more issues still arise -- I'll file another bug when I get that far. As well, the CreateErrorFromString function is currently horribly broken -- but as long as the error handling in vbnc isn't mature, I don't think it's worth proposing a fix. ---- Additional Comments From rolfkvinge@ya.com 2007-03-09 07:01:27 MST ---- Thanks for the patch, committed in r73996. There's no CreateErrorFromString in vbnc, did you mean Report.LookupErrorCode? ---- Additional Comments From rolfkvinge@ya.com 2007-03-12 14:19:16 MST ---- Bug closed. ---- Additional Comments From frederik.carlier@ugent.be 2007-03-12 15:47:29 MST ---- Your previous comment got lost in my spam filter. I'm referring to CreateErrorFromString in the VBCodeCompiler.cs file itself. It is used to parse the errors that vbnc writes to the console and throw a new exception if required. See http://svn.myrealbox.com/viewcvs/trunk/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs?rev=73996&view=markup ---- Additional Comments From rolfkvinge@ya.com 2007-03-12 16:49:04 MST ---- The error format should not change that much I think, it's supposed to mimic how vbc does it, so a fix would be welcome :) ---- Additional Comments From frederik.carlier@ugent.be 2007-03-12 17:03:17 MST ---- Opened https://bugzilla.novell.com/show_bug.cgi?id=MONO81124 to track the CreateErrorFromString bug. Imported an attachment (id=171610) Imported an attachment (id=171611) Unknown operating system unknown. Setting to default OS "Other".