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

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.

Related

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.

How to use Microsoft's Linguistics Analysis API?

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)

Building Xamarin project

I am trying to launch my Xamarin project (which is just the base project Xamarin comes with) but boy is it a nightmare. First of all I have had the IDE00006 error which never, never seems to go away. I have tried everything and some research online has told me that I need to go back to version 23.3.0 for my NuGet packages to fix this error. And so I am trying to do so but now that wont happen as I get this error:
Could not install package `Xamarin.Android.Support.v4 23.3.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I don't know what to do, I feel I have tried everything. A lot of research has outdated versions of Xamarin that do not work with my situation but some has shown me that I have something wrong with my portable class libraries or something. I don't know what to do, please help.

WebDriver in library not found

I have a library that I want to put ChromeDriver and IEDriver in so I don't have to reference those executables from each of my different testing frameworks. I have run into an issue, though, where my testing framework is looking for the drivers in the frameworks solution directory, when they exist within the library that I'm referencing. How do I solve this? Am I even going about it the right way?
Pull down the intended package through NuGet. Then Right click on on the test project>add existing>navigate to the package directory(ie chrome) and add as shown as follows.
See the screencast

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.

Categories