Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upgrade packages.config file in VB.Net projects #9

Open
zifr opened this issue Jan 18, 2018 · 5 comments
Open

Can't upgrade packages.config file in VB.Net projects #9

zifr opened this issue Jan 18, 2018 · 5 comments

Comments

@zifr
Copy link

zifr commented Jan 18, 2018

Installed product versions

  • Visual Studio: 2017 Enterprise
  • This extension: 1.0.1

Description

In a .sln file, I have a couple VB.Net projects (of type Class Library). Each references one or more NuGet packages, and under each project root is the packages.config file. The tool fails to upgrade any of the packages.config files. I've attached pasted the contents of one of the packages.config that the tool was failing on.

Steps to recreate

  1. Open solution containing several VB.Net projects.
  2. In the solution explorer, click on one of the projects
  3. On the toolbar click Project > Show all files
  4. Back in the solution explorer, find the packages.config under the project we clicked in step 2.
  5. Right click on "packages.config" > Upgrade to PackageReferences

Current behavior

In the output pane, the tool logs that the current packages.config was backed up then, on the very next step, it outputs that a null reference exception occurred. Pasted below is the full output.

Output

1/18/2018 18:16:31: Backup created for C:\[redacted]\packages.config.
1/18/2018 18:16:31: Update failed. Exceptions:
1/18/2018 18:16:31: Message: Object reference not set to an instance of an object.
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_1.<UpgradePackagesConfig>b__12(XElement c) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_0.<UpgradePackagesConfig>b__1(Int32 i) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Azure.KeyVault.Core" version="2.0.4" targetFramework="net47" />
  <package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net47" />
  <package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net47" />
  <package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net47" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net47" />
  <package id="System.ComponentModel.EventBasedAsync" version="4.3.0" targetFramework="net47" />
  <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net47" />
  <package id="System.Linq.Queryable" version="4.3.0" targetFramework="net47" />
  <package id="System.Net.Requests" version="4.3.0" targetFramework="net47" />
  <package id="System.Spatial" version="5.8.2" targetFramework="net47" />
  <package id="WindowsAzure.Storage" version="8.0.1" targetFramework="net47" />
</packages>

Expected behavior

Convert the items within the packages.config file to PackageReferences within the .vbproj file.

@patricknolan
Copy link

patricknolan commented May 23, 2018

I get the same error.

@robertmclaws could this please be fixed as this could be such a useful tool?

24/05/2018 8:37:22 AM: Update failed. Exceptions:
24/05/2018 8:37:22 AM: Message: Object reference not set to an instance of an object.
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_1.<UpgradePackagesConfig>b__12(XElement c) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_0.<UpgradePackagesConfig>b__1(Int32 i) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
24/05/2018 8:37:43 AM: Backup created for D:\workspace\e5tfs\dataract461\e5 Releases\Dev\e5 Foundation\e5 Legacy\Source\SharedAssemblies\Repository\packages.config.
24/05/2018 8:37:43 AM: Update failed. Exceptions:
24/05/2018 8:37:43 AM: Message: Object reference not set to an instance of an object.
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_1.<UpgradePackagesConfig>b__12(XElement c) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_0.<UpgradePackagesConfig>b__1(Int32 i) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

@pcleckler
Copy link

pcleckler commented Jun 20, 2018

Same. Visual Studio 2017 Enterprise v15.7.4. @robertmclaws

Would be estatic to beta test.

6/19/2018 10:34:09 PM: Backup created for C:\Users\p3c\VSTS\CoreSource\.Net Team Code\WrapApps\dev\WorkQueueProcessing\packages.config.
6/19/2018 10:34:09 PM: Update failed. Exceptions:
6/19/2018 10:34:09 PM: Message: Object reference not set to an instance of an object.
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_1.<UpgradePackagesConfig>b__12(XElement c) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CloudNimble.PackageReferenceUpgrader.NuGetUpgraderPackage.<>c__DisplayClass9_0.<UpgradePackagesConfig>b__1(Int32 i) in C:\projects\packagereferenceupgrader\src\CloudNimble.PackageReferenceUpgrader\NuGetUpgraderPackage.cs:line 187
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

@Abrahamlet
Copy link

Did they ever get around to fixing this?

@pcleckler
Copy link

pcleckler commented Mar 12, 2019 via email

@anandmajethiaindia
Copy link

anandmajethiaindia commented Apr 15, 2019

Submitted a fix. #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants