Visual Studio 2010 类无法编译的问题
我有一个 Visual Studio 2010 C# webforms 解决方案,其中包含各种项目。其中有一个类的行为很奇怪。如果我在另一个项目中打开一些代码,然后使用“转到声明”命令来访问相关类,Visual Studio 会显示 DLL 中的元数据。但是,如果我对同一项目中的另一个类执行相同的操作(同时仍然使用另一个项目中的“转到声明”),我就可以很好地获取实际代码。
当我尝试编译时也会发生同样的情况。我更改此类中的代码没有效果,Visual Studio 根本不编译更改。同样,仅针对这一类,其余所有似乎都工作得很好。
在同一项目内部使用“转到声明”是可行的。
我相信这是由于我们最近将解决方案从 .net 3.5 升级到 4 造成的,这带来了各种问题,但我们能够解决这些问题。这个特定问题目前似乎只存在于我自己的机器上,因为有问题的代码仍在开发中并且尚未签入。
我认为这并不重要,但为了完整性:所讨论的类是一个接口。
我尝试过“干净的解决方案”并删除了各种 Visual Studio 缓存文件,到目前为止似乎没有任何帮助。任何可能的解决方案都非常受欢迎。
I have a Visual Studio 2010 C# webforms solution with various projects in it. There is a certain class in one of them that acts strangely. If I open some code in another project and then use the "go to declaration" command to get to the class in question, Visual Studio shows me meta data from the DLL instead. However, if I do the same for another class in the same project (while still using "go to declaration" from another project), I get to the actual code just fine.
Same thing happens when I try to compile. I alter code in this class to no avail, Visual Studio simply doesn't compile the changes. Again only for this one class, all the rest seems to work just fine.
Using "go to declaration" from inside the same project works.
I believe this was caused by our upgrading the solution from .net 3.5 to 4 recently, which brought about a variety of issues that we were able to fix though. This particular issue only seems to exist on my own machine currently, as the code in question is still in development and not checked in yet.
I don't think it matters, but for the sake of completeness: the class in question is an interface.
I've tried "clean solution" and deleted a variety of Visual Studio cache files, nothing seems to have helped so far. Any possible solutions very welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的引用可能有问题 - 它可能引用已编译的程序集而不是项目。
尝试删除对该程序集的每个引用并将它们添加回作为项目引用。
It might be a problem with your references - it may be referencing the compiled assembly instead of the project.
Try deleting each reference to that assembly and add them back in as project references.