I'm quite new to c# and visual studio, and I'm having problems with libraries. With nuget I installed "ExcelReaderFactory" and everything work as it should, I can see all the classes and so on, but when I try to compile I get an error message "ExcelReaderFactory.cs not found". The thing that puzzles me is that the library is a .dll, so why is it even looking for an .cs file?? I hope you can clear it for me. Thank you!
Asked
Active
Viewed 1,418 times
1
-
Did you run into an exception? That could happen if an exception happened in an external library. The environment is just asking for a .cs file in order to let you know exactly *where* the exception was raised. – Vlad Oct 15 '14 at 20:32
-
i've added an image of the window popping up. That's what i know – Rasmus Damgaard Nielsen Oct 15 '14 at 20:37
-
1Right, so an exception was thrown and not caught somewhere in the `ExcelReaderFactory` and the debugger wants to locate the line of code which threw the exception, but you don't have the source code. Try catching the exception in your code... You can see what type it is in your `Output` window. – Vlad Oct 15 '14 at 20:43
-
Oh... Its right there... I just wasted hours without looking in the output window?... but thank you, do you want to write it as an answer so i can accept it, give you the points and close the question? :) – Rasmus Damgaard Nielsen Oct 15 '14 at 20:46
1 Answers
1
This is caused by an uncaught exception happening in an external library in binary form. The uncaught exception causes the debugger to jump in and try to find the line of code which caused it but because you don't have the source for ExcelReaderFactory
it will ask for the .cs file (just in case you do have the code somewhere). Nothing to worry about.
The solution here is to try to catch the previously uncaught exception caused by your external library inside your code. You can find the type of exception by looking at the Output Window.

Vlad
- 1,889
- 17
- 33