none
How to Resolve IntelliSense Issue in Visual Studio

    Question

  • 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.
    Thursday, July 21, 2016 7:37 AM

All replies

  • Hi Thomas Schneider 1234,

    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.

    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.

    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.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 22, 2016 3:35 AM
    Moderator
  • Hi WeiWei, 

    thx for the quick reply. 

    To set the record straight, we don´t refere to the \bin output folders of other solutions(projects), we copy the builded artifacts to a central shared folder (e.g. N:\SharedFolder) on a different server.
    The postbuildcommands look like this:
    "if exist "N:\SharedFolder" copy "C:\Code\TestApp\trunk\Solution2\Project2.1\bin\Debug\project2.1.*" "N:\SharedFolder""

    Solution 1 
    - Project 1.1 creates project1.1.dll -> Postbuildcommand copy to N:\SharedFolder
    - Project 1.2 creates project1.2.dll -> Postbuildcommand copy to N:\SharedFolder

    Solution 2 
    - Project 2.1 creates project2.1.dll -> Postbuildcommand copy to N:\SharedFolder
    - Project 2.2 creates project2.2.dll -> Postbuildcommand copy to N:\SharedFolder


    Then Solution 1 Project 1.1 refers to assembly  N:\SharedFolder\project2.1.dll and so on. 


    Yes, we are using a Subversion Server where all the Solutions are based.
    Your suggestion is ok, but the dlls changes very often. 
    We tried to commit them into the Subversion Repository, but the datavolume increased very strongly in short time, and we skipped that. 
    There are about 14 solutions with overall 90 projects involved and a lot of thired party dlls ( ~ 200 MB).

    As i mentioned, our approach worked very good in VS 2010. No Problems. 


    I digged a lil bit and i think there is a connection with this http://stackoverflow.com/questions/17703004/visual-studio-displaying-errors-even-if-projects-build problem.
    When someone builds project2.1.dll the dll will be replaced at N:\SharedFolder.
    In this time the N:\SharedFolder\project2.1.dll is inaccessible. 
    And I think the intellisense cache will then not update correctly for some reason and marks classes as not found. 
    Then the other vs function to remove not used namespaces kicks in and remove the using and the solution is not building. (But we also switched off that function, didn´t change anything)
    Only guesses...


    Also with VS 2015 Update 3 the situation doesn´t change.


    Best Regards
    Thomas


    Monday, July 25, 2016 9:36 AM
  • Hi Thomas,

    >>The file references point to a network path (e.g. N:\bin\project2.1.dll).

    If you add the reference from a local folder, how about the result?

    As you said that it works well in VS2010, but not work in the VS2015, could you share us a simple sample using one drive? We will debug it in our side using the same sample as yours.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, July 26, 2016 4:00 PM
    Moderator
  • Hi Jack, 

    looks like it was i bug in the microsoft Code:

    https://github.com/dotnet/roslyn/issues/11847#issuecomment-228820357

    With this Fix it works:
    https://msdn.microsoft.com/en-us/library/mt752379.aspx

    Best regards,
    Thomas

    Friday, September 23, 2016 3:22 PM
  • Hi Thomas,

    Since this issue has been resolved, please mark it as the answer, so it would be helpful for other members who meet the same issue. Thanks for your sharing again.

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, September 24, 2016 7:28 AM
    Moderator