How to use Microsoft's Linguistics Analysis API? - c#

I am trying to accomplish the ability to use Microsoft's Cognitive Service called Linguistics Analysis. The nuget package Microsoft.ProjectOxford.Linguistics does not exist, or at least I am unable to find it when I search for it.
I expect to be able to add the nuget package, however, it is not there. Has anyone tried to use it recently?

There is a NuGet package (PCL.Cognitive.LinguisticAnalysis), but it is buggy (I get errors when running AnalyzeTextAsync) and its seems it is not maintained anymore.
I suggest that you use the Client Library.
Download this repository: https://github.com/Microsoft/Cognitive-LinguisticAnalysis-Windows
Copy the ClientLibrary project to your solution
Use that ClientLibrary (you may need to update Newtonsoft.Json in this project for it to work properly)

Related

System.Media missing assembly and no nuget package for Console Project

I'm currently working on a console game and I would like to play sounds sometimes.
After a bit of research I found that I need to use System. Media. SoundPlayer class, but unable to find the System. Media namespace. I've reached several Stack Of questions, but they were inefficient in my case.
I might notice you that I've got an error while attempting manual package addition:
Unable to find an instance of Microsoft. VisualStudio.Shell.Interop.IVsReferenceManager
so I might not be able to add it manually.
I could not find a package called System. Media via VS nuget Package Explorer.
If someone could help me, I'll be highly thankful
to gain access to System.Media namespace, you'll need to install System.Windows.Extensions nuget package as #bolkay suggested. This require >=3.0 version of .net core.

How can I track down the source of a transitive dependency?

In a project/solution with lots of <PackageReference> dependencies, it can be difficult to find the source of a transitive dependency that's being pulled in. For example, no projects in my solution directly reference the package System.Data.SqlClient, but something is pulling it in transitively. Tracking that down "by hand" is virtually impossible in a large solution or project with lots of direct package references.
Is there any ready-made way (eg, a combination of .Net CLI commands) that, given a particular package, will find and reveal the source of the transitive reference? I use Rider, which has some awesome code navigation and "discovery"-type tools, but I can't find anything that helps with my goal.
Note: I also have VisualStudio if it has this capability built-in somewhere, I'd just need a pointer to where/how.
The capability is built into the latest Visual Studio 2019.
With Visual Studio 2019, Update 6, I can see something like the following:
Note that you can also discover packages by searching in the solution explorer.
Unfortunately it's not available in the NuGet Package Manager installed view yet.
Searching in VS did not work for me, at least not for a BCL package like System.Net.Http. What did work is looking in obj\project.assets.json, which lists all dependencies.
It's still a somewhat manual process of searching for each package up the tree. https://www.jerriepelser.com/blog/analyze-dotnet-project-dependencies-part-2/ describes the process well and provides code to automate it, but I have not tried the code.
Since I had the same problem and didn't find anything working (on SO, google and my installed VS2022 Ultimate), I've create a powershell and python script.
The script uses the nuget-deps-tree - npm package to get a dependency tree and then traverses this tree to find the nuget.
See: https://github.com/Kraego/NailDownNuget
Not an ideal solution in many cases but just to mention it. Switching to paket dependency manager could help as well, especially for bigger projects.
It has a command called paket why that quickly tells you for each package whether it's a top level, a direct or a transient dependency and additionally shows the dependency chain. See this blog post for some examples.

Automatically Propagating Changes from Parent to Dependent custom NuGet packages using TeamCity

My company uses the built in TeamCity NuGet repo to create custom NuGet packages that often depend on each other. When I, say, update a .cs page in a custom parent package I'd like for those changes to propagate to all of our packages that are dependent packages of the parent - I believe I can accomplish this using a NuGet installer to "update packages".
My fear is that while I know I can force this update upon all our packages, I want to find a way to exclude anything that isn't hosted on our company repo (which should also mean anything that is hosted on the NuGet.org repo), so anything that we are using from an outside source isn't lumped into this NuGet update.
Preferably, I'd like to know if there's a way to handle this in the our .nuspec for each of our packages (though it seems wildcards don't accomplish this). Any insight to my problem here?
Honestly, it sounds a bit like you're trying to re-create the project reference experience with NuGet packages. If it's at all reasonable to do so, perhaps your best option would be to have all projects in a single solution and use project references instead.
If you're able to migrate your projects to SDK style projects (used by .NET Core, but you can still target the .NET Framework), then you can use dotnet list package or the dotnet-outdated tool. dotnet list package --outdated has an option to specify a list of sources to use. Perhaps if you only specify your private feed it may only search that one. Otherwise the script you create to do all this will need to overwrite the nuget.config file to remove other sources (like nuget.org) when running the command to get your desired output. Then you parse the output and when it finds an update, it modifies the relevant file(s).

Which nuget package holds the Microsoft.WindowsAzure.StorageClient.dll in Nuget

I just got a new computer at work and started to migrate my projects to VS2013. Now the problem is that with Azure SDK 2.4 the DLL Microsoft.WindowsAzure.StorageClient.dll is not included in it anymore.
I found this this post on the matter, were it was told that they were kept out of the 2.4 in order to keep it lighter and you need to add them in using NuGet.
OK, that's fair enough, but I've tried for hours to find the correct package with no luck. Anyone knows with package holds that DLL?
You're trying to add Microsoft.WindowsAzure.StorageClient.dll which is really-really old version of Storage Client library (thus not recommended). But if you're trying to get this DLL, try this link: http://www.nuget.org/packages/WindowsAzure.Storage/1.7.0.

Nuget as a package manager

I'm looking to work on an application, an internal toolbelt if you will.
Rather than having users messing around with DLL's for the differing tools (they plug in via MEF) I was wondering if it's possible to jump on the back of Nuget?
I'd build the tools, package them as nuget packages and host them internally and the toolbelt application would then query the catalog, retrieve and extract etc etc.
Does anybody know of a way this is possible?
Chocolatey uses nuget as an underlying package manager to install applications on your pc.
http://chocolatey.org/
So I'm sure it's possible, but I've not done it myself.
The nuget documentation discusses a command line and power shell reference: http://docs.nuget.org/
Also linqpad, does something similar (in the paid for version), where you can include dll's from nuget. There is a screen shot on this page: http://www.linqpad.net/purchase.aspx

Categories