locked
XAML intellisense stopped working for project RRS feed

  • Question

  • We are working on a WPF-based application and have recently lost XAML intellisense on the project. Here's what we've discovered:

    1. XAML intellisense only fails to work in XAML files where we reference a CLR namespace inside the current assembly (using xmlns:s="clr-namespace=Namespace.Name"). 
    2. If we clean the solution, XAML intellisense works for all XAML files no matter what namespace is referenced - even for custom controls
    3. If we then rebuild the solution, intellisense stops working again 
    4. If after building we add an assembly reference pointing to the current assembly to the namespace references (using xmlns:s="clr-namespace=Namespace.Name;assembly=CurrentAssemblyName"), intellisense works again, but building fails (I'm assuming because we're trying to reference an assembly that hasn't been built yet)

    Has anyone experienced anything like this before?

    Monday, February 23, 2009 3:56 PM

Answers

  • We found the cause of the issue - the project in question is referencing some of our common class libraries that have dependencies on unmanaged DLLs. These DLLs were added to the project and set to copy to the output folder, so at runtime the exe found them and everything worked great. However, (apparently) the intellisense engine in VS2008 doesn't look at the output folder to load the assemblies so it couldn't find the unmanaged DLLs, and in turn wasn't able to load the built assembly. Rather than giving an error, intellisense just stopped working.

    As a work-around, we copied the unmanaged dlls to the %SystemDirectory% (system32) and intellisense started working.

    Monday, February 23, 2009 10:47 PM

All replies

  • Hi Jonathan

    Sorry to hear you're having this issue. I have a few supplementary questions:

    1. What version of Visual Studio are you using (Visual Studio 2008 RTM? Visual Studio 2008 SP1?)
    2. Does the problem happen on multiple machines, or just a single machine (I am guessing from your post that you are working in a team with multiple members using VS?)
    3. Does the problem happen on brand new projects (e.g. if you create a new WPF project, add a simple class to the project, and reference via an xmlns, do you see the same issues you are describing), or does it only happen on a particular project?
    4. If only on a particular project, can you share that project with us or is it too large/sensitive to share?

    Thanks

    Mark
    Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'
    Monday, February 23, 2009 10:23 PM
  • We found the cause of the issue - the project in question is referencing some of our common class libraries that have dependencies on unmanaged DLLs. These DLLs were added to the project and set to copy to the output folder, so at runtime the exe found them and everything worked great. However, (apparently) the intellisense engine in VS2008 doesn't look at the output folder to load the assemblies so it couldn't find the unmanaged DLLs, and in turn wasn't able to load the built assembly. Rather than giving an error, intellisense just stopped working.

    As a work-around, we copied the unmanaged dlls to the %SystemDirectory% (system32) and intellisense started working.

    Monday, February 23, 2009 10:47 PM
  • Thanks for letting us know the results of your investigation.

    I'll pass this feedback on to the owners of the intellisense engine to see if there are improvements we can make to be more robust againt this issue in future releases.

    Mark

    Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'
    Tuesday, February 24, 2009 12:15 AM
  • Ok, I found the answer, i needed to add the ogreMain.dll which was not used as reference but linked to the c# wrapper....


    Hello,

    I have the same problem than you using this project: http://www.codeproject.com/KB/WPF/OgreInTheWpf.aspx .

    I put the unmanaed Dlls in the system32 dirs but it does not still works....

    Do you have any clues ?

    Thx by advance,

    Jmix.

    PS: The intelissense works back just by removing the xmlns def of the assembly....
    Thursday, March 5, 2009 11:27 AM
  • Jonathan,

    I have entered a bug for the IntelliSense issue you reported.  Thank you for reporting and providing additional information on the exact cause.

    Have a great day,

    Karl
    Program Team - WPF & SL Designer for Visual Studio
    Wednesday, March 25, 2009 4:39 PM
  • Thanks for the tip. This bug has been driving me crazy for over a month. I can finally start working with a fully functional development environment!
    Tuesday, October 27, 2009 10:11 PM
  • I had the same problem and I think I found the solution.

     To have Xaml intellisense working and build continuing to succeed, when you have a reference to a local assembly, you must declare it adding ";assembly=" without assembly name.

    In your example (xmlns:s="clr-namespace=Namespace.Name;assembly=")

    Hope this help !

     

    Friday, April 23, 2010 3:48 PM

  • For Your Information:

    I have been struggling with this issue for weeks, and I have tried almost all proposed solutions to fix it. This has definitely been a pain in the ____. In my case the WPF designer crashed to desktop whenever I hit the < key in xaml editor, which normally should launch the IntelliSense.

    After tremendous amount of painful investigation I was able to find out the cause of the problem by excluding files and commenting out classes in the project. In my case the following class structure was apparently causing the mechanism behind IntelliSense to crash:

     

    Public Class Foo
    ...
    End Class
    
    Public Class Foo(Of T)
     Inherits Foo
    ...
    End Class

     

    Altough this seems to be syntactically correct in VB, replacing the code with following fixed the CTD problem:

    Public Class Foo
    ...
    End Class
    
    Public Class TypedFoo(Of T)
     Inherits Foo
    ...
    End Class

    Just my 10 cents - this might not be the case in all WPF designer crash issues, but apparently there may be some improper design patterns or naming conventions which may cause the IntelliSense to crash.

    Hope this helps someone!

    -h-

    Tuesday, April 27, 2010 7:28 AM
  • This fixed the problem for me. Thanks Helian.
    Wednesday, April 28, 2010 2:52 PM
  • Thanx Helian. Magical, the issue just disappear suddenly with this gimmick. :)
    Searching... wondering...
    Thursday, September 30, 2010 10:00 AM
  • OUr development team is encountering the same issue.

    Is there a target date or SP planned that would include the resolution.

    - Steve

    Thursday, October 28, 2010 5:08 PM