ICodeCompiler and Forms with Images

W

Wolfgang Link

hello group,
for my VB.NET application I need a console app. to compile them.
But I get a MissingMethodException on the device / emulator.

The testproject is very simple:
- place one picturebox with an image on the form
- in form_load place: msgbox("Hello world")

If I compile it with VS it works fine.
If I compile it with my console app. the error occurs.
If I compile it with my console app. without the messagebox it works
fine.

Whats wrong ?

Here is my console app. code:
---------------------------------------------------------------------------------
....
Dim cdp As CodeDomProvider
cdp = New VBCodeProvider

Dim compiler As ICodeCompiler = cdp.CreateCompiler()
Dim cpParameters As CompilerParameters = New CompilerParameters
With cpParameters


.OutputAssembly = "resTest"

.GenerateExecutable = True
.MainClass = "resTest.frmStart"

.IncludeDebugInformation = False
.GenerateInMemory = False
.WarningLevel = 3
.TreatWarningsAsErrors = False
.TempFiles = New TempFileCollection("temp", True)

'// Resourcen angeben
strResourcen = "/resource:resTest.frmStart.resources "

'// Imports:
strImports = "Microsoft.VisualBasic,"
strImports &= "System,"
strImports &= "System.Data,"
strImports &= "System.Collections,"
strImports &= "System.Configuration,"
strImports &= "System.Drawing,"
strImports &= "System.Diagnostics,"
strImports &= "System.Windows.Forms"


.CompilerOptions = "/netcf /target:winexe
/rootnamespace:resTest /optimize /optionstrict- /optionexplicit+
/optioncompare:binary /recurse:test\*.vb " & strResourcen & "
/debug:full /imports:" & strImports

strPath = "c:\Programme\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE\"
.ReferencedAssemblies.Add(strPath & "mscorlib.dll")
.ReferencedAssemblies.Add(strPath &
"Microsoft.VisualBasic.dll")
.ReferencedAssemblies.Add(strPath & "System.dll")
.ReferencedAssemblies.Add(strPath & "System.Data.dll")
.ReferencedAssemblies.Add(strPath & "System.Drawing.dll")
.ReferencedAssemblies.Add(strPath &
"System.Windows.Forms.dll")
.ReferencedAssemblies.Add(strPath & "System.Xml.dll")
End With

Dim cr As CompilerResults =
compiler.CompileAssemblyFromSource(cpParameters, "")
 
W

Wolfgang Link

Thank you, but is there another chance to compile netcf code without
the VS Studio IDE ?
With a dos batch or other ... ?

regards wolfgang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top