Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include source instead of a library in C# / Visual Studio?

I come from a long Java background and very new to C#. I was trying to run one of the starter kit applications from Windows phone and I am getting this error.

A first chance exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.WindowsPhone.dll

I am finding it hard to debug this because I am directly referring to the dll file under References pointing to Newtonsoft.Json.WindowsPhone. In Java, I would have searched for the library and downloaded the source to step into the exact location during debugging.

If that is possible, how would I do it in C# (as in how would i refer the library source for my project to pick up at run-time)? I am using the Visual studio 2010 Express Edition as the IDE.

like image 863
bragboy Avatar asked Jun 10 '12 22:06

bragboy


2 Answers

  1. Download the third party library you are dealing with
  2. Add this library's project into your solution
  3. In your project, remove the reference to the 3rd party library
  4. Add a project dependency into your project, make it depend on the 3rd party library project you have just added to your solution
  5. Compile and run, happy debugging
like image 187
GETah Avatar answered Nov 02 '22 22:11

GETah


My best guess is you should download last release of Json.NET, remove the compiled library from your project's references and add reference to the source code project. (Add Reference... > Projects > Browse...)

like image 31
Dan Abramov Avatar answered Nov 02 '22 22:11

Dan Abramov