问题描述
我有一个ASP.Net c#项目,试图访问另一个项目中的类中的方法.它适用于该类中方法的前半部分,但不适用于我最近添加的该类中的方法的另一半.它们可以编译,但是会在运行时抛出未找到异常的方法.
I have an ASP.Net c# project trying to access methods in a class in another project. It's working for first half of methods in the class but not for the other half of the methods in the class which I recently added. They compile, but they throw a method not found exception at run-time.
有人有我可以尝试的想法吗?我尝试过:
Does anyone have any ideas I could try? I've tried:
- 重新创建
.sln
文件 - 潜入另一个我知道有效的类库项目.看来该错误出在我的主项目中,该主项目在另一个项目中调用了该方法.
推荐答案
找不到方法"是一个非常具体的错误,这意味着期望(即在编译时存在)的一种方法不存在.这通常意味着您正在部署的文件与您认为的文件不同-特别是,我押注您正在部署库的 old 版本(缺少您添加的内容).
"Method not found" is a very specific error, which means a method it expected (i.e. was there at compile time) simply is not present. This usually means that the files you are deploying are different to what you think they are - specifically, I would wager that you are deploying the old version of the library (which lacks your additions).
对照您认为的内容检查部署到网络服务器的dll.
Check the dlls deployed to the web-server against what you think they should be.
这篇关于在运行时找不到方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!