类库项目文件不编译成.dll或调试 [英] Class Library Project File not compiling into .dll or debugging

查看:207
本文介绍了类库项目文件不编译成.dll或调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的解决方案中:




  • 我有一个可以编译成dll的类库项目。

  • <我有一个web项目。


(我有不同的Web项目的多个解决方案,但是同一个类库)



类项目中的一个文件(utilities.cs) - 突然不会编译到.dll

我已经更改了这个文件,但这个更改不会显示在网站上。所以我在.cs文件中放了一个断点,并尝试运行它...断点没有被击中!最后我把一个断点放在调用函数的.aspx文件中。然后我调试器一行,所以它会进入.cs文件,除了我得到错误:



这个源文件已经改变了,不再匹配用于构建正在调试的应用程序的文件的版本。



所以,utilities.cs中的代码没有被更新到dll中。这是奇怪的,因为我的其他.cs文件中的代码正在更新(我尝试更改几行),并且能够捕获调试。



任何想法如何解决这个问题?甚至是什么原因导致的问题?

解决方案

尝试:

右键单击 解决方案资源管理器 - > 属性 - > 配置属性 - >确保构建复选框被选中为您的类库。


in my solution:

  • i have a class library project that compiles into a dll.
  • i have a web project.

(i have multiple solutions with different web projects but the same class library)

one of the files in the class project (utilities.cs) - all of a sudden won't compile into the .dll

i had made a change to this file, but the change wouldn't show on the website. so i put a breakpoint in the .cs file, and tried running it... breakpoint didn't get hit! eventually i put a breakpoint in the .aspx file that called the function. then i stepped the debugger one line on, so it would step into the .cs file, except i got the error:

"This source file has changed. It no longer matches the version of the file used to build the application being debugged."

so the code in utilities.cs is not being updated into the dll. which is weird, because code in my other .cs files IS being updated (i tried changing a few lines) and IS able to catch the debug.

any ideas how to fix this? or even what the cause of the problem is??

解决方案

Try:
Right click on Solution in Solution Explorer -> Properties -> Configuration Properties -> Make sure Build checkbox is checked for your class library.

这篇关于类库项目文件不编译成.dll或调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆