System.BadImageFormatException was unhandled???
-
sexta-feira, 26 de novembro de 2010 15:56
Hi
I work a project in c#, but when i run the project i get this exception what can I do???
System.BadImageFormatException was unhandled
Message="Corrupt .resources file. Got an unexpected EndOfStreamException while trying to read the ResourceReader header."
Source="mscorlib"
StackTrace:
at System.Resources.ResourceReader.ReadResources()
at System.Resources.ResourceReader..ctor(Stream stream, Dictionary`2 resCache)
at System.Resources.RuntimeResourceSet..ctor(Stream stream)
at System.Resources.ResourceManager.CreateResourceSet(Stream store, Assembly assembly)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture)
at Kafrain.Properties.Resources.get__11() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Kafrain16_Test\Kafrain\Properties\Resources.Designer.cs:line 72
at Kafrain.controlScreen.InitializeComponent() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Kafrain16_Test\Kafrain\ControlScreen.Designer.cs:line 740
at Kafrain.controlScreen..ctor() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Kafrain16_Test\Kafrain\ControlScreen.cs:line 447
at Kafrain.Program.Main() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Kafrain16_Test\Kafrain\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.EndOfStreamException
Message="Unable to read beyond the end of the stream."
Source="mscorlib"
StackTrace:
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt32()
at System.Resources.ResourceReader.ReadResources()
InnerException:
.............................please help me....
thanks
Ruba.Z.K
- Tipo Alterado raboosh sexta-feira, 26 de novembro de 2010 16:19
Todas as Respostas
-
sexta-feira, 26 de novembro de 2010 18:10please any body help me......
-
segunda-feira, 29 de novembro de 2010 07:04
Hi Raboosh,
Thanks for your post.
It might be a platform target issue and this application is 32bit runs in a x64 OS.
If so, could you please try to force the app to run in WoW64 you can go to the project properties in VS, right click project node->properties, select the "build" tab, and set the "platform target" to x86.
If it doesn't work, be free to let me know.
Ziwei Chen
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marcado como Resposta Victor_Chen segunda-feira, 6 de dezembro de 2010 08:33
-
terça-feira, 6 de dezembro de 2011 07:23
Thanks Victor for sharing this information..
i facing exception with BadImageFormatException was unhandled
i changed platform target AnyCPU to x86....Now i got anther error :The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Please let me know where i have to fix this error..
Thanks in advance..
- Sugerido como Resposta marcmc1978 segunda-feira, 5 de março de 2012 16:59
- Não Sugerido como Resposta marcmc1978 segunda-feira, 5 de março de 2012 16:59
-
segunda-feira, 5 de março de 2012 17:01
I was getting this error message on my deployment project whilst everything was ok in debug mode.
I spent half a day reading up on it.
For me as it turned out I had a Resource directory in my project that was empty.
I excluded it from the project and the error went away.
Really hope that helps someone somewhere along the line.

