Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 09:18

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[CodeDom]In 32bit Compilen?

Discussion on [CodeDom]In 32bit Compilen? within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
beatd0wn[]'s Avatar
 
elite*gold: 220
Join Date: Mar 2011
Posts: 247
Received Thanks: 75
[CodeDom]In 32bit Compilen?

Cheers,
Ich benutze folgende CodeDom Funktion:
Code:
Imports System.CodeDom.Compiler
Public Class Compiler
    Public Shared Sub GenExe(ByVal Output As String, ByVal Source As String, ByVal Icon As String)
        On Error Resume Next

        Dim Compiler As ICodeCompiler = (New VBCodeProvider).CreateCompiler()
        Dim Parameters As New CompilerParameters()
        Dim cResults As CompilerResults

        Parameters.GenerateExecutable = True
        Parameters.OutputAssembly = Output

        Parameters.CompilerOptions = "/target:winexe"
        Parameters.ReferencedAssemblies.Add("System.dll")
        Parameters.ReferencedAssemblies.Add("System.Data.dll")

        Dim Version = New Dictionary(Of String, String)
        Version.Add("CompilerVersion", "v2.0")

        Parameters.CompilerOptions = "/filealign:0x00200 /optimize+ /debug- /target:winexe"

        Dim ICO As String = IO.Path.GetTempPath & "\iCompiler.ico"

        If Icon <> "" Then
            IO.File.Copy(Icon, ICO)
            Parameters.CompilerOptions &= " /win32icon:" & ICO
        End If

        cResults = Compiler.CompileAssemblyFromSource(Parameters, Source)

        If cResults.Errors.Count > 0 Then
            For Each CompilerError In cResults.Errors
                MessageBox.Show("Error: " & CompilerError.ToString, "", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Next
        ElseIf cResults.Errors.Count = 0 Then

        End If
        If Icon <> "" Then : IO.File.Delete(ICO) : End If
    End Sub
End Class
Eigentlich funktioniert alles einwandfrei ich habe jedoch folgedens Problem:
Mein OS is Win7 64bit, muss es aber hinbekommen, dass der compiler eine 32bit .exe erstellt. Jemand eine Idee?
beatd0wn[] is offline  
Old 02/12/2012, 15:55   #2

 
x]vIrus[x's Avatar
 
elite*gold: 37
Join Date: Apr 2004
Posts: 2,154
Received Thanks: 250
bei den compileroptions musst noch "/platform:x86" hinzufügen
x]vIrus[x is offline  
Reply


Similar Threads Similar Threads
Compilen
08/06/2011 - Flyff Private Server - 1 Replies
Hallo, dass ist vielleicht eine dumme Frage aber wie compiled man? Danke schon einmal im Vorraus :D
Codedom Guide für C#?
11/23/2010 - .NET Languages - 1 Replies
Servus, ich würde mich gerne mit näher mit dynamischen Code in CSharp beschäftigen, und dafür ist wohl am besten Codedom geeignet. Nun zu meiner Frage, gibt es dafür (gute) deutsche Guide's? Englische gibt es genug, aber kann leider keine in der deutschen Sprache finden. Bevor ich mich an einen englischen ranwage wollte ich hier nachfragen ob jemand einen solchen Guid im Repertoire hat :D Wenn sowas nicht existiert, zumindest nicht wirklich brauchbares, würde mir



All times are GMT +1. The time now is 09:19.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.