What to do when package version cannot be found however I can see it on nuget.org? - nuget

I have a project where I need Microsoft.TeamFoundation.DistributedTask.Common.Contracts. According to nuget.org there is a 15.114.0-preview package. But, Visual Studio says that there is no package like this.
I clean all local cache and doesn't help.
How can I solve it? Generally, how much time is needed for a package to go through the spreading process if there is any?

You seem to be looking at the wrong package in Visual Studio Package manager window.
Microsoft.TeamFoundation.DistributedTask.Common.Contracts has latest version as 15.114.0-preview
while Microsoft.TeamFoundation.DistributedTask.Common has latest version as 15.112.1
Hope this helps.
-AG.

Related

How do I automatically install a nuget package from a roslyn code fixer

I try to add a nuget package reference automatically to a visual studio project if needed, with the help of a roslyn code fixer.
Since the "CodeFixProvider" is not a "Microsoft.VisualStudio.Shell.Package" there is no GetGlobalService Method to retreive a "IComponentModel" in order to get the "IVsPackageInstaller2" service.
Is there another or an even better way to add a nuget reference to a project?
I am a bit lost here after days of googling.
Thanks in advance!

Can't Find certain extensions in CODE-OSS(Open source variant of Visual Studio Code)

I have been using Code-OSS in manjaro linux for some months now and this is the first time I am encountering this. (After I reinstalled manjaro) When I search for e.g, Java Extension Pack or Intellisense I don't get any result in the extension marketplace. I don't know if it's the problem of my setup or everyone is experiencing this. If you know of a solution please tell me.
Thanks in advance
This can be fixed by adding following to product.json:
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
This can also be fixed by copying product.json from an official build (in the .zip archvie, product.json is under /usr/share/code/resources/app/product.json which contains above lines). Depending on your distribution, exact location may vary.
More information: https://github.com/Microsoft/vscode/issues/1557
As an alternative to manually editing product.json or building whole visual-studio-code-bin from AUR you can use different AUR package - code-marketplace - that patches product.json from Code OSS package (code)
Thank you #Clay for responding. I saw that post prior to me posting this question. Those bits of json code were already in my product.json file but still I was not able to get the extensions. Then I built the VISUAL STUDIO CODE (visual-studio-code-bin) from AUR and now its working normally as expected. I don't know what's the reason behind this,but that's how I fixed it.
Also if someone is reading this and wanna know about the different variants of VSCode then here is the archWiki page for VSCode.
For anyone using the lscr.io/linuxserver/code-server docker container like me, the .json is located at /app/code-server/lib/vscode/product.json.
I've encountered this using OSS Code on Manjaro as well, trying to install the Azure Resource Manager Tools extension. Not sure if this was an option when this question was posted, but you can download the extension (.vsix) file if possible, then bring up 'quick open' in OSS Code using Ctrl+Shift+P, search for "VSIX" and choose "Extensions: install from VSIX" to locate and install the downloaded .vsix file.
After this, the extension was installed and usable in OSS Code, and is also configurable in the extension manager panel.

Autofac.Extensions.Hosting NuGet?

Does anyone know how to install Autofac.Extensions.Hosting from a NuGet package within Visual Studio (2019)? I see the project here GitHub Autofac.Extensions.Hosting. Within the project instructions, it states that you can "reference the from NuGet". However, I can't find it within Visual Studio's NuGet Package Manager. Is it not available yet, or am I doing something wrong.
Thanks.
It was never published because it's basically just one extension method. The readme needs to be corrected. If you need the extension method, just copy paste it.

package manager in visual studio code

I've been using visual studio code as a second display (with visual studio as the first) to view/edit code mostly JavaScript since you can right click/format the code with easy.
But I recently took to time to study how it's c#/asp.net core debug functionality has evolved and it seems it has become even more easier to start whipping debug in no time.
But there is one thing I haven't figured out and whether it's even possible. That's it managing nuget packages. Visual studio offers a nice package manager ui to view installed packages and which packages might need a version bump.
It's there an alternative for visual studio code other than browsing the nuget site and checking which of your referenced packages have updated and editing the .csproj manually or running dotnet add <project> package ...?
This is probably not relevant anymore, but for anyone else also searching for something like this, there is a pretty handy extension for VSCode called Package Manager GUI here.

Visual Studio 2017 Communnity Incorrectly Updates Roslyn Scripting

I am using Roslyn for application scripting via Nuget Package Manager. Setup should be rather simple. Create new project and, in Nuget manager, add Microsoft.CodeAnalysis.Sripting package. After couple of confirmations you are ready to go.
Next step should be checking for installed packages update. Currently, there are 5 updates that are shown after initial installation. Again, it is pretty straightforward to do this.
However, immediately after the update, two of those packages show yellow triangle in Reference node of the project.
I have tried to resolve this following SO and other hints but nothing helped me so far.
At the end, I have installed new VM with Windows 10 Pro (with all updates) and VS2017 Community Edition. After that new Windows Forms project (.net 4.6.1. based for x64) was created and scripting package is added. Unfortunately, yellow triangles are still there (after update).
Problematic packages are System.ValueTuple and System.Security.Cryptography. X509Certificates.
Also, after cleaning and rebuilding the solution, a number of warnings (MSB3836) - explicit binding redirect on "System..." conflicts with autogenerated binding redirect.
Solution to this problem might shed a light on problem with more complex solution that I stumbled upon after migration to VS 2017.
So, what is the reason for such behavior? Remember, this happens on new installation of OS and VS with simplest project possible.
Visual Studio 2017 Communnity Incorrectly Updates Roslyn Scripting
I got the same result with you steps. This issue only occurred on the Visual Studio 2017 not Visual Studio 2015. That should have some issue with package Microsoft.CodeAnalysis.
To resolve this issue, I would like provide you a workaround:
Update packages "System.ValueTuple" and "System.Security.Cryptography. X509Certificates" first, then update other packages.
It works fine on my side, you can check if it works for you.
In order to track this issue, I have create a new issue on GitHub:
https://github.com/dotnet/roslyn/issues/22290
If you have additional information to add, you can add comments below that issue. And you can check the feedback from this link.