TypeInitializationException
-
18-06-2021 - |
문제
I tried to zip files(ie.images,txt,doc....) in c# and tried this (which gives a answer by using J#
)
using java.io;
using Java.util.zip;
\\part of code which throws exception
private void button1_Click(object sender, EventArgs e)
{
Zip(@"D:\Zipped.zip",new string[]{"ico_1.ico","readme.txt"});
}
private void Zip(string zipFileName, string[] sourceFile)
{
FileOutputStream filOpStrm = new FileOutputStream(zipFileName);
Exception message:
'The type initializer for 'java.io.File' threw an exception.'
I found that the problem is on FileOutputStream
.. But, cant find a way to to solve it.. And all i want is a solution to solve this issue and reason for this Exception....
올바른 솔루션이 없습니다
다른 팁
Debug it! Debug the code line by line in IDE, then you can know which line throw this exception.
When a class initializer fails to initialize a type, a TypeInitializationException is created and passed a reference to the exception thrown by the type's class initializer. The InnerException property of TypeInitializationException holds the underlying exception.
제휴하지 않습니다 StackOverflow