Ich wollte, da unsere Schule kein .NET FW 4 und schon garkein .NET 4.5 auf den Rechnern hat, das Mono Framework nutzen und die Assemblys dann von einem Framework unabhängig machen.
Funktioniert auch z.T. bestens, nur habe ich ein Problem mit der Auswahl eines Datenbank Providers.
DataSet kommt nicht in Frage, weil ich dann keine 1:1 Relation bauen kann.
SqlCe fällt raus, da das Mono Framework kein SqlCe Pendant hat.
Was bleibt ist Sqlite.
Was denkt man sich also? Nutz ich Sqlite.NET oder Mono.Data.Sqlite? Korrekt, also Sqlite.NET einbauen. Referenz auf System.Data.SQLite und System.Data.SQLite.Linq gesetzt, kompiliert. Ausgeführt (.NET 4.5) und yay es geht.
Das ganze noch schnell per
unabhängig machen und dann solls das gewesen sein.
Rechner denkt sich so "pff, das mach ich nich" und lässt die Anwendung nicht starten. Warum auch? SQLite is ja nich da.
Also ausgeführt und? -Richtig, nichts.
Schmeißt man also SQLite.NET in die Ecke und holt sich Mono.Data.Sqlite heran.
Also schnell die App.config manipuliert
und es sollte ja gehen, richtig?
Das .NET 4.5 meint jetzt aber, dass
Das läuft natürlich auch nicht:
Kann mir jemand sagen, warum der den Müll a) nicht starten will und mir b) den "CAS-Assertionen können nicht in SecurityTransparent-Methoden durchgeführt werden"-Fehler wirft und wie ich die zwei Sachen beheben kann?
(wenn b behoben wurde, sollte a automatisch laufen)
Funktioniert auch z.T. bestens, nur habe ich ein Problem mit der Auswahl eines Datenbank Providers.
DataSet kommt nicht in Frage, weil ich dann keine 1:1 Relation bauen kann.
SqlCe fällt raus, da das Mono Framework kein SqlCe Pendant hat.
Was bleibt ist Sqlite.
Was denkt man sich also? Nutz ich Sqlite.NET oder Mono.Data.Sqlite? Korrekt, also Sqlite.NET einbauen. Referenz auf System.Data.SQLite und System.Data.SQLite.Linq gesetzt, kompiliert. Ausgeführt (.NET 4.5) und yay es geht.
Das ganze noch schnell per
Rechner denkt sich so "pff, das mach ich nich" und lässt die Anwendung nicht starten. Warum auch? SQLite is ja nich da.
Also ausgeführt und? -Richtig, nichts.
Schmeißt man also SQLite.NET in die Ecke und holt sich Mono.Data.Sqlite heran.
Also schnell die App.config manipuliert
XML-Quellcode
- <system.data>
- <DbProviderFactories>
- <add name="Mono Sqlite Provider" invariant="Mono.Data.Sqlite" description="Mono Framework Data Provider for SQLite" type="Mono.Data.Sqlite.SqliteFactory, Mono.Data.Sqlite, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
- </DbProviderFactories>
- </system.data>
Das .NET 4.5 meint jetzt aber, dass
Das läuft natürlich auch nicht:
Quellcode
- $ mkbundle -o Simulation.exe WirtschaftsSimulation.exe Mono.Data.Sqlite.dll --deps
- OS is: Windows
- Sources: 2 Auto-dependencies: True
- embedding: D:\Dokumente\Projekte\WirtschaftsSimulation\WirtschaftsSimulation\bin\Debug\WirtschaftsSimulation.exe
- config from: D:\Dokumente\Projekte\WirtschaftsSimulation\WirtschaftsSimulation\bin\Debug\WirtschaftsSimulation.exe.config
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\EntityFramework.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\mscorlib.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.Security.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Configuration.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Xml.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Security.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Core.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.Posix.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Data.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.Data.Tds.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Transactions.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.EnterpriseServices.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Runtime.Serialization.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Xml.Linq.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.ComponentModel.DataAnnotations.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Microsoft.CSharp.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.CSharp.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Windows.Forms.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\System.Drawing.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Accessibility.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.WebBrowser.dll
- embedding: C:\PROGRA~2\MONO-2~1.4\lib\mono\4.5\Mono.Data.Sqlite.dll
- Compiling:
- as -o temp.o temp.s
- i686-pc-mingw32-gcc -U _WIN32 -g -o Simulation.exe -Wall temp.c `pkg-config --cflags --libs mono-2|dos2unix` temp.o
- temp.c: In function ‘install_dll_config_files’:
- temp.c:87:2: Warnung: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness
- C:/PROGRA~2/MONO-2~1.4/include/mono-2.0/mono/metadata/assembly.h:101:15: Anmerkung: expected ‘const char *’ but argument is of type ‘const unsigned char *’
- Done
Kann mir jemand sagen, warum der den Müll a) nicht starten will und mir b) den "CAS-Assertionen können nicht in SecurityTransparent-Methoden durchgeführt werden"-Fehler wirft und wie ich die zwei Sachen beheben kann?
(wenn b behoben wurde, sollte a automatisch laufen)