如何解决Visual Studio中的IntelliSense问题 [英] How to Resolve IntelliSense Issue in Visual Studio

查看:276
本文介绍了如何解决Visual Studio中的IntelliSense问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Project is losing reference when referenced assemblies changed in backround.

In our Company are several Visual Studio Developers. 
Everyone is using Visual Studio 2015 (Update1 or Update2)
We are using .net C# 4.0.

We are using different Solutions for related features.
Solution 1 
- Project 1.1 creates project1.1.dll
- Project 1.2 creates project1.2.dll

Solution 2 
- Project 2.1 creates project2.1.dll
- Project 2.2 creates project2.2.dll

and so on.

Some projects refer to other projects in the same solution, but also in projects other solutions.
For example: Solution 1 Project 1.1 refers to assembly  project2.1.dll
Because its in an other Solution, this is not an Project reference. It is a File reference.
The file references point to a network path (e.g. N:\bin\project2.1.dll)

Every project has a postbuild command which runs after building and copies the created assemblies into a network path (N:\bin\). 

Works fine in Visual Studio 2010. 
Now with Visual Studio 2015 we got the following problem.


Problem:
Developer A has solution 1 open.
Developer B build solution 2 (project 2.1). (Only comments were changed)

Developer A gets red squiggly lines under random classes and interfaces and says "this namespace doesn't exist". 
But the
But the Project can be build without errors. 

After VS 2015 restart everything is ok, untill someone is building the Project 2.1 again.

How can we solve this Problem. Its very annoying.

推荐答案

Thomas Schneider 1234,

Hi Thomas Schneider 1234,

我将根据您的描述创建两个示例解决方案,并将它们都放在两个不同的VM中.我将解决方案2 Project 2.1.dll共享给每个人,该文件可以让我从另一台VM访问此dll,该文件位于项目\ Bin \的路径中.

I create two sample solution based on your description and both of them in two different VMs. And I share the Solution 2 Project 2.1.dll which is in the path project\Bin\ to everyone which can let me access this dll from another VM.

我尝试通过文件系统从解决方案1的计算机访问此dll,并且成功.然后,我开始使用共享路径添加对解决方案1项目1.1的引用.但是,当我尝试在解决方案1中使用Proejct 2.1命名空间时,它无法 被认可.这与您提到的不同,直到dll更改后才可以使用.

I try access this dll from the solution 1 machine through the file system and it is successful. Then I start add reference to the Solution 1 Project 1.1 with the shared path. But when I try to using the Proejct 2.1 namespace in my solution 1, it could not be recognized. Which is not the same as your mentioned which is can be used until the dll changed.

然后根据您的情况,建议您使用源代码管理来管理这两个解决方案,这可以使每个开发人员将解决方案映射到本地计算机.然后,该项目可以引用本地计算机中的另一个项目dll,这不受以下因素的影响: 另一个开发商.当引用的dll中的某些功能发生更改时,您只需要通过源代码控制对其进行更新,然后就可以在当前计算机中使用更改后的功能.

And according to your situation, I suggest you manage these two solution with source control which can let every developer map the solution to local machine. Then the project could reference another project dll in local machine, which is not effected by another developer. When some function changed in the referenced dll, you just need to update it through the source control and then you can use the changed function in your current machine.

最好的问候,
Weiwei

Best Regards,
Weiwei


这篇关于如何解决Visual Studio中的IntelliSense问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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