How can I install Naudio Nuget package in C# WPF - c#

There is no Naudio version for my .net 4.5 project. I need to install it but it says
"Error Could not install package 'NAudio 2.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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."

NAudio 2.0.0 targets .NET Standard 2.0. which is not supported by .NET 4.5.
.NET implementation support
You have two options:
Change the target framework of you project to at least .NET 4.6.1 but recommended version is .NET 4.7.2
Install NAudio 1.10.0 instead of 2.0.0. NAudio 1.10.0 supports .NET 3.5+

You need to install the previous version like by running this command in package manager console Install-Package NAudio -Version 1.10.0

Related

issue while installing Square nuget pacge in visual stdio

Error Could not install package 'Square 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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 face this issue on version 4.5 , all version of square not installed on this version of website
If you check the page for that package over on nuget.org you'll see that it is built against .NET Standard 1.3. If you then check what .NET version that corresponds to over on Microsofts documentation for .NET Standard you'll also see that .NET Standard corresponds to .NET 4.6. So you can't install this package in a project that targets .NET 4.5.
Also, it is the same requirements for Square 8.1.0 so you should probably get that version instead of 4.0.0.

Could not install Dapper 2.0.4 on .Net 4.6.1

I'm trying to install Dapper 2.0.4 via nuget manager as i want to use the latest Dapper.Contrib features
It didn't proceed due to the following error:
Could not install package 'Dapper 2.0.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', 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.
If i install the lower version (1.6), the installation went successful but i can't use the latest Contrib features.
How can i resolve this?
Hoping for your kind help. Thank you.
I tried the following and it worked for me.
Check Target Framework by right-clicking on the project and selecting the Application tab. If the target framework is .NET framework 4.6.1
Install-Package Dapper -Version 2.0.4 works fine.
If the target framework is less than 4.6.1 (In my case another project has target framework 4.5.2) try installing previous versions of Dapper for example:Install-Package Dapper -Version 1.50.2
Try this instead
Go to "Tools > NuGet Package Manager > NuGet Manager Settings > Package Sources
Once in Package Sources, set name to "Package Source" and Source to "https://www.nuget.org/api/v2/package/Dapper/" then update to save
Install .Net Framework SDK version 4.7.1 minimum.
Select installed target as a Target Framework for all Projects in your Solution
(in Project properties).
Retarget all packages in all projects executing update-package -reinstall -
ignoreDependencies from the Package Manager Console.
Install Dapper.
That should do it for you.
Install .Net Framework SDK version 4.7.1 minimum.
Select installed target as a Target Framework for all Projects in your Solution (in Project properties).
Retarget all packages in all projects executing update-package -reinstall -ignoreDependencies from the Package Manager Console.
Install Dapper.
UPDATE (from comments):
Dapper needs .NET Standard 2.0. Please retry the whole procedure including re-targeting with .NET Framework 4.7.2 as this is the first fully compliant with. Source: weblog.west-wind.com/posts/2019/Feb/19/

Installing a .NetStandard 2.0 Nuget package into a VS2015 Net 4.6.1 project

I'm trying to install a Nuget package that targets .NetStandard 2.0 (Microsoft.Extensions.Logging.Abstractions) into a Net 4.6.1 project in Visual Studio 2015. However, while Frameworks should be compatible, it doesn't quite work:
Install-Package : Could not install package 'Microsoft.Extensions.Logging.Abstractions 2.0.0'. You are trying to
install this package into a project that targets '.NETFramework,Version=v4.6.1', 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.
At line:1 char:1
+ Install-Package Microsoft.Extensions.Logging.Abstractions
I've followed the steps outlined here: Entity Framework Core 2.0 on .NET 4.6.1
So I have installed package "NETStandard.Library.NETFramework", and added
<PropertyGroup>
<PackageTargetFallback>netstandard2.0</PackageTargetFallback>
</PropertyGroup>
to the csproj. But, no luck there - still the same issue.
Is there any way to install a NetStandard 2.0 package into my project (without upgrading VS or installing any Net Core targeting packs or such)?
Thanks
Referencing .NET Standard 2.0 packages is supported using the following:
NuGet 3.6.0 or higher for VS 2015 (from NuGet's download site - may not yet be listed as recommended latest)
Install the ".NET Standard Support for Visual Studio 2015" from https://aka.ms/netstandard-build-support-netfx (NuGet in VS will also print a link to this in its output window).
There are a still few bugs when consuming .NET Standard 2.0 libraries, especially when mixing .NET Standard < 2.0 and 2.0 libraries but these updates give basic support.
Is there any way to install a NetStandard 2.0 package into my project (without upgrading VS or installing any Net Core targeting packs or such)?
I am afraid not. Just like Jon pointed out that the reason for that issue is that you are using Visual Studio 2015.
According to the .NET Standard, .NET Standard 2.0 support .NET Framework 4.6.1 (with .NET Core 2.0 SDK):
So we need install .NET Core 2.0 SDK. And every communication from Microsoft about the preview of .NET Core 2.0 mentions Visual Studio 2017, so I think it's highly recommanded to use Visual Studio 2017 to work with .NET Core 2.0.
Besides, the NuGet package NETStandard.Library.NETFramework is deprecated.
So install a .NetStandard 2.0 Nuget package into a Net 4.6.1 project, I highly recommanded to use Visual Studio 2017 to work with .NET Core 2.0.
Hope this helps.

Cannot update Microsoft.Extensions.Logging to (2.0) Mono Develop 6.1.4

My packages in my project indicated there was a version update to 2.0 for:
Microsoft.Extensions.Logging
NETStandard.Library
Microsoft.NETCore.Platforms
The only one I cannot get to update is Microsoft.Extensions.Logging
The Error I get is this:
Package 'Microsoft.Extensions.Logging 2.0.0' does not exist in folder '/home/MyUser/UpdatedPon/pon/sbmanager/packages'
Could not install package 'Microsoft.Extensions.Logging 2.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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 have been searching the internet the past few days looking for a solution, but I have not found one as of yet.
Has any one ran into this issue, I am running MonoDevelop 6.1.4
and my MONO version is 5.2.0.215.
Lastly this is a WebForms application.
The Microsoft.Extensions.Logging 2.0.0 NuGet packages has assemblies for .NET Standard 2.0.
A more recent version of NuGet is required for .NET Standard 2.0 to be recognised as a target framework. So you would need to use MonoDevelop 7.1 for this to work. Also your project would need to target .NET 4.6.1 to be able to install the NuGet package.
Alternatively you could try installing the older version Microsoft.Extensions.Logging 1.1.2 which contains .NET Standard 1.1 assemblies which should be recognised by MonoDevelop 6.1.

Farsi.Library 2.7.0 Fails to install

I tried to install Farsi.Library 2.7.0 through the NuGet Package Manager Console.
But following error occurs:
Install-Package : Could not install package 'Farsi.Library 2.7.0'. You
are trying to install this package into a project that targets
'.NETFramework,Version=v4.5.2', 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.
According to his blog entry all versions of this library beyond and including version 2.6 are based on .NET Framework 4.6 - somehow this fixes a few bugs with the persian calendar. This is why the installation fails for you.
Install version 2.5.1.5, the latest version of this library which is based on .NET Framework 2.0, to bypass this.
Or upgrade your project to .NET Framework 4.6 or later.
Install-Package Farsi.Library -Version 2.5.1.5

Categories