vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
Re: VS 2005 > VS 2010 Problem 
Autor: divinglog
Datum: 08.12.10 15:30

Hallo

Vielen Dank für die Antworten! Die genaue Fehlermeldung ist:

Zitat:

Die Datei oder Assembly "file:///Pfad-zur-Datei/Divinglog.Controls.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.


Ich verwende noch die DevExpress 9.3 Version, hab aber auch schon ein Upgrade auf die neueste 10.1 gemacht, was auch keinen Unterschied gebracht hat. Aber: Ich habe glaube ich nach langem Googlen die wahrscheinliche Ursache gefunden:

http://blogs.msdn.com/b/visualstudio/archive/2010/05/07/building-on-cross-targeting-scenarios-and-64-bit-msbuild.aspx

Dort heißt es:

Zitat:

An error occurs when compiling a .resx file with MSBuild
Description:

On a 64-bit OS you have a project targeting the x86 platform and it targets 3.5 .NET Framework or below. Your project has a reference to a 32-bit only assembly, and when you build you get the following error:

ResourceFrm.resx(1436,5): error RG0000: Could not load file or assembly '32bitOnlyAssembly.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 1436, position 5.

This issue is caused by the fact that in the 3.5 .NET tools resgen.exe in both the x86 and x64 bin directories is marked as IL (architecture agnostic), causing it to run on a 64-bit Operating System as a64-bit executable no matter what. As a 64-bit process, resgen.exe is unable to load the 32-bit only library.

Also if you are targeting 4.0 .NET, MSBuild will fail in the same way if you are referencing a 32-bit only assembly while using 64-bit MSBuild and vice versa.
Affected scenarios:

Cross targeting scenarios while building projects which contain resource files with MSBuild:

1. In a 64-bit Operating System If you are targeting 3.5 .NET and the project references a 32-bit assembly with either 32-bit or 64-bit MSBuild.
2. The project references a 32-bit assembly and you are using 64-bit MSBuild.
3. The project references a 64-bit assembly and you are using 32-bit MSBuild.

Workaround:

1. Make the library referred on the error target the AnyCPU platform, or (if this is not a option as the assembly involved is produced from a third party)
2. You need to workaround the fact that resgen.exe is shipped as an MSIL tool on the Windows SDK, to do so follow these steps:
1. Use corflags to set the 32bit flag on resgen.exe, to do so open a Visual Studio command prompt and type:
1. # corflags /32bit+ "%ProgramFiles(x86)%\Microsoft SDKs\Wndows\v7.0A\bin\resgen.exe" /force
2. Add in the project file the following property:
1. <ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>
3. NOTE: this workaround will cause problems if you have also resx files that have types declared on 64-bit assemblies.


Ich denke das ist genau das Problem, das bei mir auftritt. Vorallem weil der Debugger immer in die resx Datei springt bei dem Fehler. Ich bin mir aber fast sicher das ich meine Assemblies nicht ohne Grund fest als x86 kompiliert habe. Wenn ich mich richtig erinnere hat das damals nicht funktioniert, AnyCPU Assemblies in einem x86 Programm unter 64 Bit laufen zu lassen. Ich werde das jetzt aber nochmal versuchen.
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
VS 2005 > VS 2010 Problem4.547divinglog08.12.10 02:19
Re: VS 2005 > VS 2010 Problem3.867ModeratorDaveS08.12.10 09:01
Re: VS 2005 > VS 2010 Problem3.913ChrizzleWhizzle08.12.10 09:07
Re: VS 2005 > VS 2010 Problem3.873ModeratorFZelle08.12.10 09:39
Re: VS 2005 > VS 2010 Problem4.786divinglog08.12.10 15:30
Re: VS 2005 > VS 2010 Problem3.973ModeratorFZelle08.12.10 16:46
Re: VS 2005 > VS 2010 Problem3.941divinglog08.12.10 17:07
Re: VS 2005 > VS 2010 Problem4.073divinglog08.12.10 18:19

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel