Proposed Solution for fixing Work Item 1556

Sep 29, 2011 at 4:24 AM
Edited Sep 29, 2011 at 4:25 AM

This is my proposed solution for fixing 1556 http://nuget.codeplex.com/workitem/1556 

I go through the problem and found that if we have VS 2011 installed, one of the project is automatically referenced to the latest version of Microsoft.VisualStudio.ExtensionsExplorer.dll which is v4.0_11.0.0.0__b03f5f7f11d50a3a instead of v4.0_10.0.0.0__b03f5f7f11d50a3a.

Can I fix it by setting Specific Version = True? It can be my very first contribution. :)

Sep 29, 2011 at 6:47 AM

Are you sure it still works if you set Specific Version = True? Have you tried it on machine with only VS 2011 installed wihout VS 2010?

Sep 29, 2011 at 6:57 AM

No. I haven't tried it yet. I like to know whether you guys are okay with setting the version or not in first place. If you guys are okay then I will setup new fresh VM and test it during this weekend. 

 

According to the doc, NuGet runs in Visual Studio 2010 or Visual Web Developer 2010.  So, I'm guessing that setting  "Specific Version = True" will make sure that it runs on VS 2010. 

Additionally, I look at the code and I found that there is  #if VS10 ..  If you are opening the code in VS 11, the code inside #if VS10 won't run..   

Sep 29, 2011 at 7:10 AM

The reason why there is a #if VS10 is that the version 10 of that assembly is not available in VS 11. Why do you want to change it?

Sep 29, 2011 at 4:11 PM
dotnetjunky wrote:

Why do you want to change it?

I'm just trying to find the solution.. It's not like I want to change or anything if it's working.. :) 

It's not just that assembly. The project is referring the 11 version of assemblies ended with *.VisualStudio.Extension*  

Sep 29, 2011 at 4:34 PM

I don't think these assemblies have anything to do with the bug 1556. #1556 is about the PowerShell fxCop assembly which is only loaded when building from command line.

Sep 30, 2011 at 2:55 AM
dotnetjunky wrote:

I don't think these assemblies have anything to do with the bug 1556. #1556 is about the PowerShell fxCop assembly which is only loaded when building from command line.

Yes. It might be an PS FxCop issue as well.

But I should be able to open NuGet.sln in Visual Studio 2010 and build it, right? Currently, it's giving the error from the project that has this assembly Microsoft.VisualStudio.ExtensionsExplorer.dll . I'm guessing it might be the same issue ... Or, maybe. different issues but I'm sure that you can't build it in VS 10 if your machine has VS 11 installed so we have to fix it somehow. 

I will install the fresh machine on VM and test it ...

Sep 30, 2011 at 4:13 AM
Edited Sep 30, 2011 at 4:13 AM

what error do you see when you open the solution from VS 10? I don't have that problem. I can build fine from VS 10 even with VS 11 installed. I only have problem with running build.bat from the command line.

Oct 1, 2011 at 9:18 AM

In Dialog10, I got the following error.

 

Error 2 'NuGet.Dialog.Providers.RootPackagesTreeNode' does not implement interface member 'Microsoft.VisualStudio.ExtensionsExplorer.IVsExtensionsTreeNode.Extensions'. 'NuGet.Dialog.Providers.RootPackagesTreeNode.Extensions' cannot implement 'Microsoft.VisualStudio.ExtensionsExplorer.IVsExtensionsTreeNode.Extensions' because it does not have the matching return type of 'System.Collections.IList'. C:\NuGet\MyFork\src\Dialog10\Nodes\RootTreeNode.cs 10 18 Dialog10

Error 1 'NuGet.Dialog.Providers.PackagesTreeNodeBase' does not implement interface member 'Microsoft.VisualStudio.ExtensionsExplorer.IVsExtensionsTreeNode.Extensions'. 'NuGet.Dialog.Providers.PackagesTreeNodeBase.Extensions' cannot implement 'Microsoft.VisualStudio.ExtensionsExplorer.IVsExtensionsTreeNode.Extensions' because it does not have the matching return type of 'System.Collections.IList'. C:\NuGet\MyFork\src\Dialog10\Nodes\PackagesTreeNodeBase.cs 16 29 Dialog10

Oct 1, 2011 at 9:32 AM

That project is referencing the following assemblies. When I changed it to Version "v4.0_10.0.0.0__b03f5f7f11d50a3a" then it works. 

F:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.ExtensionsExplorer\v4.0_11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.ExtensionsExplorer.dll
F:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.ExtensionsExplorer.UI\v4.0_11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.ExtensionsExplorer.UI.dll

Oct 1, 2011 at 12:33 PM

That's interesting. On my machine, even though Specific Version = false, it still references the version 10 of the assemblies. Not sure why it switches to version 11 on your machine. OK, I think you can set Specific Version to true. Make sure you test that it's still working on machine with only VS 2010 and machine with only VS 11.

Oct 1, 2011 at 4:09 PM
dotnetjunky wrote:

On my machine, even though Specific Version = false, it still references the version 10 of the assemblies. 

Could you please checking whether you have two versions under this folder F:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.ExtensionsExplorer\ ? 

Changing the references helped me to build the project from Visual Studio but  it doesn't fix the FxCop issue. :) 

I think that the version of Microsoft.PowerShell.CodeAnalysis.dll under Nuget\FxCop folder is different from this release http://archive.msdn.microsoft.com/FxCopPowerShellRules/Release/ProjectReleases.aspx?ReleaseId=4909, Right? 

Because I was able to add the Microsoft.PowerShell.CodeAnalysis.dll from Nuget as new rule in FxCop 10. But when I analyze Console.Types project with FxCop after adding new rules, I got the exception.  Please check this screenshot http://archive.msdn.microsoft.com/FxCopPowerShellRules/WorkItem/AttachmentDownload.ashx?WorkItemId=2&FileAttachmentId=15716

I can't even add this assembly http://archive.msdn.microsoft.com/FxCopPowerShellRules/Release/ProjectReleases.aspx?ReleaseId=4909 in FxCop. I opened new ticket in their site http://archive.msdn.microsoft.com/FxCopPowerShellRules/WorkItem/View.aspx?WorkItemId=2 

 

 

 

 

Oct 5, 2011 at 11:52 AM

Yes, I do have two versions of ExtensionsExplorer in there, version 10 and 11.

I don't remember from where I got the MS.PS.CodeAnalysis.dll. Have you figured out what is wrong with it? If not, I can consider temporarily disabling it for now.