PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
ICodeCompiler and Forms with Images
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
ICodeCompiler and Forms with Images
![]() |
ICodeCompiler and Forms with Images |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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, "") ---------------------------------------------------------------------------------- thanks wolfgang |
|
|
|
#2 |
|
Guest
Posts: n/a
|
There is no support of VBCodeProvider/ICodeCompiler for CF (see Version
Information in the link below): http://msdn2.microsoft.com/en-us/li...tecompiler.aspx Also it seems that you created the "Windows Application" instead of "Smart Device Application". -- Sergey Bogdanov [.NET CF MVP, MCSD] http://www.sergeybogdanov.com Wolfgang Link wrote: > 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, "") > > ---------------------------------------------------------------------------------- > > thanks wolfgang > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thank you, but is there another chance to compile netcf code without
the VS Studio IDE ? With a dos batch or other ... ? regards wolfgang |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

