Intellisense not working for Prism Namespaces

Topics: Prism v4 - WPF 4
Jun 23, 2011 at 10:35 AM
Edited Jun 23, 2011 at 10:37 AM

Hi,

I have created a sample HelloWorld prism application which builds and runs fine. However, I am not getting the IntelliSense (auto complete feature) for Prism namespaces in my xaml files. I have copied the Prism dll and Xml files in sub folder of my project and then added reference to that folder. Here is how I am declaring the xml namespace

 

<UserControl x:Class="PrismHelloWorld.HelloWorld"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:PrismHelloWorld"
             xmlns:prism="http://www.codeplex.com/prism"
             >

 

When I type <prism: in xaml, I do not get any auto-complete entries box. The Visual Studio instead lists the following error in Errors window

"Error 3 The type 'prism:<Unknown>' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. D:\C#_Practice\Prism\PrismHelloWorld\PrismHelloWorld\HelloWorld.xaml 12 6 PrismHelloWorld"

Any ideas why Visual Studio prints the above error (and also why there is not intellisense for prism namespace) ? Please note that the application is still able to run properly, inspite of these errors.

regards,

Nirvan.

Jun 23, 2011 at 5:31 PM

I have identified when this problem occurs but don't know how to solve it. The IntelliSense breaks up after I add Reference to "Microsoft.Practices.Prism.Interactivity.dll" in my project. Can anyone please help me resolve this problem ?

regards,

Nirvan.

Jun 23, 2011 at 6:18 PM

Hi Nirvan,

I tried to reproduce this issue on my environment, but I found that the intellisense is working properly with the Prism namespace, whether I add a reference to the Prism.Interactivity library or not.

You could try executing the RegisterPrismBinaries.bat file, located in the installation folder in order to register Prism in the GAC, and then reference the Prism binaries from the .NET tab in the Add Reference Dialog.

If that doesn’t help, the problem you’re experiencing might be related to the configuration of your environment.

Please, let me know if this information helps you.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

 

Jun 23, 2011 at 7:02 PM
Edited Jun 23, 2011 at 7:03 PM

Miguel,

I am pretty sure that I get the problem only after adding Prism.Interactivity dll to the project. To confirm that when I remove the Prism.Interactivity from my project and rebuild the project, I get the Intellisense working for Prism namespace. I am using Visual Studio Express, so I cannot use RegisterPrismBinaries.bat. 

Thanks for the response.

Nirvan.

Jun 24, 2011 at 4:33 AM
Edited Jun 24, 2011 at 4:42 AM

I am really struggling to get this problem resolved. Out of all the six dll's in Prism bin folder, only the Microsoft.Practices.Prism.Interactivity.dll is causing the <prism: namespace Intellisense to break. Any help please. 

regards,

Nirvan.

Developer
Jun 24, 2011 at 1:02 PM

Hi Nirvan,

We've not received similar issues so far. We've tried to reproduce your problem under different scenarios but we were unable to experience the error you're mentioning.

You could try adding the Microsoft.Expression.Interactions and System.Windows.Interactivity libraries into your project.

If that doesn't fix the problem, you could create a work item in the issue tracker, so that the Prism team considers reviewing this on a future version.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Jun 24, 2011 at 2:06 PM

Guido,

         Your tricked worked. Indeed adding Microsoft.Expression.Interactions and System.Windows.Interactivity somehow got Intellisense for all namespaces (including Prism) to work properly.

Thanks a lot.

Nirvan