Answered by:
.net framework

Question
-
I am facing a strange problem in one of our system. The system.data.dll is 0 kb in C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder. The system is running windows 7 and is a 64 bit machine. When I try to connect to database[sql server 2005] it gaives me the error:
System.BadImageFormatException: could not load file or assembly System.data.
I am clueless. How can the dll be of 0kb. Moreover If I try to rename or delete the 0kb system.data.dll it won't let me do so.[Access Denied.]
Wednesday, January 4, 2012 9:45 AM
Answers
-
Dear All,
Ultimately I had to format and install the OS again. And now I am not facing any problem. BTW thanks you all for sharing your thoughts.
- Marked as answer by Paul Zhou Monday, January 16, 2012 5:06 AM
Monday, January 16, 2012 4:33 AM
All replies
-
go to windows explorer exe in system director. Right click and click on "Run as administrator". select you file from newly opened windows explorer and delete it. By default windows 7 does not allow you to do so. But i strongly recommend no to do this. Alternative for that is re-run your .net setup with proper access rights (may be with admin acess if possible).
Regards, Ashwin. ShettyWednesday, January 4, 2012 9:52 AM -
Do not look for your System.dll in C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder. Though properties window shows System.dll is referenced from this path, at runtime, the DLL is actually refernced from C:\Windows\Microsoft.NET\Assembly\GAC_MSIL\System\<version>\ folder.
Then coming to your BadImageFormat exception, it should be coming from some other DLL. I guess, one of your DLL is a 32Bit DLL which cannot run under 64 bit process. To solve the issue build your project in x86 mode (you can do that in project properties window).
I hope this helps.
Please mark this post as answer if it solved your problem. Happy Programming!Wednesday, January 4, 2012 10:29 AM -
Hello Sanjay,
Any updates on this?
Please mark this post as answer if it solved your problem. Happy Programming!Friday, January 6, 2012 7:29 AM -
Hi,
I noticed that there is a remarkable difference in the size of C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder. In the machine where the exception occurs its 64 mb[291 files and 37 folder] while on other machine where no exception occurs its 160 mb[558 files 48 folders]. Can there be any chance that the os was not installed properly. and since framework is a part of the os in windows 7 I think I have to format the system and reinstall the OS.
BTW whats the size of C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder in fresh machine.?
Monday, January 9, 2012 8:24 AM -
You need not re-install OS. Just install .net framework. You can download .NET Framework V2.0 from here.
I hope this helps.
Please mark this post as answer if it solved your problem. Happy Programming!Monday, January 9, 2012 8:30 AM -
I think you can't install .net framework separately. Its a part of the operating system.Monday, January 9, 2012 12:38 PM
-
Try it
Please mark this post as answer if it solved your problem. Happy Programming!Monday, January 9, 2012 2:09 PM -
You cannot install .net framework in windows 7.Tuesday, January 10, 2012 4:17 AM
-
Yes, it is a part of Windows OS. You can follow steps in the link below to repair it:
I hope this can help you.
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Tuesday, January 10, 2012 7:45 AM -
Dear All,
Ultimately I had to format and install the OS again. And now I am not facing any problem. BTW thanks you all for sharing your thoughts.
- Marked as answer by Paul Zhou Monday, January 16, 2012 5:06 AM
Monday, January 16, 2012 4:33 AM