如何在C#/ Visual Studio中包含源而不是库?

时间:2023-01-19 20:58:14

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.

我来自很长的Java背景,对C#来说很新。我试图从Windows手机运行其中一个入门套件应用程序,我收到此错误。

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.

我发现很难调试这个,因为我直接引用指向Newtonsoft.Json.WindowsPhone的References下的dll文件。在Java中,我会搜索库并下载源以在调试期间进入确切的位置。

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.

如果可能,我将如何在C#中执行此操作(如何在运行时将库项源引用到我的项目中)?我使用Visual Studio 2010 Express Edition作为IDE。

4 个解决方案

#1


4  

  1. Download the third party library you are dealing with
  2. 下载您正在处理的第三方库

  3. Add this library's project into your solution
  4. 将此库的项目添加到您的解决方案中

  5. In your project, remove the reference to the 3rd party library
  6. 在项目中,删除对第三方库的引用

  7. Add a project dependency into your project, make it depend on the 3rd party library project you have just added to your solution
  8. 将项目依赖项添加到项目中,使其依赖于刚刚添加到解决方案中的第三方库项目

  9. Compile and run, happy debugging
  10. 编译并运行,快乐调试

#2


2  

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...)

我最好的猜测是你应该下载Json.NET的最新版本,从项目的引用中删除已编译的库,并添加对源代码项目的引用。 (添加参考...>项目>浏览...)

#3


1  

Once you have stopped your program in the debugger, you can use the modules window to load the symbols for Json.NET. Obviously, you need to have the symbols on your machine so you can browse to them.

在调试器中停止程序后,可以使用模块窗口加载Json.NET的符号。显然,您需要在机器上放置符号,以便浏览它们。

Failing that, you can switch to a project reference and include Json.NET in your solution as Dan suggested.

如果做不到这一点,您可以切换到项目参考,并在Dan建议的解决方案中包含Json.NET。

#4


0  

The easiest way is to download their latest build then inside visual studio right click your solution and under add menu select existing project point to project file of the library and click open button. after that u will be able to set brakepoint wherever u want.

最简单的方法是在Visual Studio中下载最新版本,然后右键单击您的解决方案,在添加菜单下选择现有项目指向库的项目文件,然后单击打开按钮。之后,你可以在任何你想要的地方设置刹车点。

#1


4  

  1. Download the third party library you are dealing with
  2. 下载您正在处理的第三方库

  3. Add this library's project into your solution
  4. 将此库的项目添加到您的解决方案中

  5. In your project, remove the reference to the 3rd party library
  6. 在项目中,删除对第三方库的引用

  7. Add a project dependency into your project, make it depend on the 3rd party library project you have just added to your solution
  8. 将项目依赖项添加到项目中,使其依赖于刚刚添加到解决方案中的第三方库项目

  9. Compile and run, happy debugging
  10. 编译并运行,快乐调试

#2


2  

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...)

我最好的猜测是你应该下载Json.NET的最新版本,从项目的引用中删除已编译的库,并添加对源代码项目的引用。 (添加参考...>项目>浏览...)

#3


1  

Once you have stopped your program in the debugger, you can use the modules window to load the symbols for Json.NET. Obviously, you need to have the symbols on your machine so you can browse to them.

在调试器中停止程序后,可以使用模块窗口加载Json.NET的符号。显然,您需要在机器上放置符号,以便浏览它们。

Failing that, you can switch to a project reference and include Json.NET in your solution as Dan suggested.

如果做不到这一点,您可以切换到项目参考,并在Dan建议的解决方案中包含Json.NET。

#4


0  

The easiest way is to download their latest build then inside visual studio right click your solution and under add menu select existing project point to project file of the library and click open button. after that u will be able to set brakepoint wherever u want.

最简单的方法是在Visual Studio中下载最新版本,然后右键单击您的解决方案,在添加菜单下选择现有项目指向库的项目文件,然后单击打开按钮。之后,你可以在任何你想要的地方设置刹车点。