0username / nugetswitcher Goto Github PK
View Code? Open in Web Editor NEWExtension for switching references in projects: PackageReference to ProjectReference.
Extension for switching references in projects: PackageReference to ProjectReference.
Please my dear you do awesome work can you support Visual Studio 2022 version.
https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022#extensions-without-running-code
Can you edit and upgrade extension and its nuget packages please to Visual Studio 2022
Thank you dear
Hello,
I installed your extension in VS2022 successfully, but when I tried to enter its options after restarting VS I get the following error:
Here are the logs:
<entry>
<record>831</record>
<time>2022/10/14 02:15:37.703</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Performance warning: String load failed. Pkg:{FDB266B8-B91A-4BFD-B391-A4E013C176E2} (Main) LANG:0409 ID:0
</description>
</entry>
<entry>
<record>832</record>
<time>2022/10/14 02:15:37.704</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Performance warning: String load failed. Pkg:{FDB266B8-B91A-4BFD-B391-A4E013C176E2} (Main) LANG:0409 ID:0
</description>
</entry>
...
<entry>
<record>847</record>
<time>2022/10/14 02:15:45.168</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [Main]</description>
<guid>{FDB266B8-B91A-4BFD-B391-A4E013C176E2}</guid>
</entry>
<entry>
<record>848</record>
<time>2022/10/14 02:15:45.174</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Main]Source: 'NuGetSwitcher.VSIX' Description: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=17.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=17.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Threading, Version=17.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
 at NuGetSwitcher.VSIX.Main.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
 at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass20_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
 at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</description>
<guid>{FDB266B8-B91A-4BFD-B391-A4E013C176E2}</guid>
<hr>80070002</hr>
<errorinfo></errorinfo>
</entry>
The same messages also occurs when I try using the extension's buttons.
I'm at version 0.8.0 o the extension.
Best,
We use a microservice style architecture. So, we have a lot of small solutions that mostly contain a project, then a test project for testing the other project in the solution. The problem we have run into is that we have a CoreProject which becomes a NuGet Package and is referenced by everything else. Therefore, the path to the CoreProject is configured in the configuration file.
The problem appears when I load the CoreProject solution which contains 2 projects: CoreProject and CoreProjectTests. Now, the CoreProjectsTests project contains a Project Reference to the CoreProject. It also contains a Package Reference to our BastTesting project.
I would like to be able to use the NuGetSwitcher on this solution to replace the PackageReference to our BaseTesting Project with a Project Reference. When I do so, it also adds a duplicate reference to the CoreProject in the CoreProjectTests project.
Let me try to illustrate:
We have 2 Projects that get built as NuGet packages that everything else uses:
The path for each of these is in the configuration file. I then have the following solution:
Solution:
The CoreProjectTests project file has:
When I use the NuGetSwitcher, it updates the CoreProjectTests project file to use a project reference for the BaseTesting as expected, but also adds a duplicate project reference to CoreProject.
I looked into fixing it myself, but didn't have much luck. One very important caveat that I should point out is that my existing Project Reference to CoreProject uses a relative path rather than an absolute path, and must continue to do so because of our CI pipeline and build environment. In looking at the code for this extension, I see absolute path comparisons, and I suspect that may have something to do with the issue.
Any help you could provide would be GREATLY appreciated.
I have attached a sample project structure for testing purposes.
Reproduced in Microsoft Visual Studio Community 2019 Version 16.4.2.
Steps to reproduce:
It removes the project, but it doesn't add the PackageReference again.
With a brand new install of VS2022 on a newly formatted pc, you cannot get to the option page to set the file path.
Repro:
Packages are deleted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.