views:

1903

answers:

4

I'm getting used to the new IDE (it's vc# express), but the first contact is somewhat confusing. When I open the Add Reference dialog and switch to the .NET tab, a label above the assembly list states: "Filtered to:.NET Framework 4". And it's true - I can reference .NET 4.0 assemblies only plus things like XNA 3.1. However I can't see older assemblies i.e. Managed DirectX libs, which are obviously installed on my computer as there was no trouble with adding a ref to them in vc#08.

What is this? How to change the filter? The label is read-only. These sound like dull guy's questions, but I'm out of lack of finding an answer and there is no intuitive solution.

Thanks in advance.

+3  A: 

Change your new application to target the .NET Framework 4 and not .NET Framework 4 Client

"When you create a new application, some projects target the .NET Framework 4 Client Profile by default."

http://msdn.microsoft.com/en-us/library/cc656912.aspx

"If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4. "

Robert Williams
Thanks for info. However, my application was targeting .NET Framework 4 already. Then I tried to change the target to Client Profile and back to full framework with hope it'll repair a possible deadlock. No effect. While .NET Framework 4 Client Profile is set, the label on Add Reference window says "Filtered to:.NET Framework 4 Client Profile".Changing framework target to v3.5 results in displaying some additional assemblies, e.g. WindowsForms 2.0, but MDX is still not there. It makes sense, because it's built for an earlier framework version. In my case the filter is nothing but a spoiler.
rook
+1  A: 

I was having a similar problem until I noticed that the older .NET assemblies were actually in the list, there's just some really strange sorting going on. If you sort by assembly name, you should see them in the proper order.

Scott Anderson
I read about the sorting problem, so I kept it in mind. However to be sure, I followed your advice, but it only confirms the problem. Some assemblies are not there!
rook
Thanks, it's helped me! Sad, they tried to improve the dialog window bu actually made it worse. The sorting, for instance, does not work before the asynchronous load has completed. You click on grid headers and nothing happens.
Developer Art
+2  A: 

Hi rook,

We've created a tool that will help you to achieve your goal. Muse VSReferences will allow you to add a Global Assembly Cache reference to the project from Add GAC Reference menu item.

alt text

Regards

Muse VSExtensions
Nice tool Muse. Very useful, cheers.
Fly_Trap
It was some time until I got full version of VS2010 (the edition in question was Express). Your extension works fine, but a case-insensitive search would be useful, at least optionally.
rook
+1  A: 

How to change the filter?

Very simple - you must change the Target .NET Framework for your project, as whole. It's not pain :) just RMB on project name in Solution Explorer->Properties->Application tab->Target Framework(combobox). Select what you want. Change combobox == change filter in Add Reference dialog. ;)

Smarty