Can't get NLog 2.0.1 version from NUGet - dll

In Visual Studio 2010, in Package Manager Console I type:
Install-Package NLog -Version 2.0.1
And I'm getting 2.0.0 (on disk). On Codeplex there's no 2.0.1 version. Version 2.0.1 is required for ServiceStack.Logging.NLog because of error:
Can't load file 'NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of it dependencies. (Exception HRESULT: 0x80131040)
Version 2.0.1 is also listed on NuGet available packages.
I have replaced NLog.dll and ServiceStack.Logging.NLog.dll with files from latest ServiceStack v3 snapshot and my program runs fine (ASP .Net4 Web Application) but this is not solution for long time. In ServiceStack snapshot NLog.dll is 2.0.0 and ServiceStack.Logging.NLog.dll is 1.0.8.

Try NLog version 2.0.1.1 or 2.0.1.2 from NuGet.
The NLog assembly in those packages has a version of 2.0.1.0

Related

[Azure Function]Could not load file or assembly 'System.Configuration.ConfigurationManager'

.Net Core 3.1. I used System.Runtime.Caching library, it depends on System.Configuration.ConfigurationManager.
But there is a amazing thing happened, I test it in MS unit test project[.NET Core 3.1], it runs well, then in Azure Function project[.NET Core 3.1], it will throw 'Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.' error, and in project .deps.json, also have dependency configurations
Below is Stack Trace:
System.Configuration.ConfigurationManager 6.0 won't support .net SDK 3.1, so update the "System.Configuration.ConfigurationManager" version to 4.7.0 and any other lower version. and try it.
According to your description, it seems it missed the nugetpackage System.Configuration.ConfigurationManager inside your application.
I suggest you could install the package System.Configuration.ConfigurationManager inside the local and re-publish again.
Install-Package System.Configuration.ConfigurationManager

Could not load file or assembly 'Microsoft.Extensions.Options, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60

After adding some nuget packages, my asp.net core app has stopped working and started to generate this error once deployed to Amazon windows server [Works OK on my dev machine (as always :-)].
Visual Studio: 2019
Target Framework: netcoreapp3.1
Installed: dotnet-hosting-5.0.7 + dotnet-sdk-5.0.401
in my deps.json file, the Microsoft.Extensions.Options always appear in the right version (3.1.10) and never in 5.0.0 version.
Any ideas where the problem might come from?
I had similar issue. The error is:
FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Options, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified
The fix: upgrade Microsoft.Extensions.Options in Nuget from version 2.x.x to latest version (version 5.0.0) and delete all obj and bin folders and rebuild.
My projects are on .NET Framework 4.7.2. When Microsoft.Extensions.Options get updated, several other Nuget packages that were also on version 2.x.x also got updated.
After uninstalling most of the Nuget packages and reinstalling them with the right version, the problem was resolved.

The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found

I tried to upgrade my web app from .net core 2.0 to .net core 2.1
I did:
1) Install Visual Studio Professional 2017 Preview Version 15.8.0 Preview 1.1
2) Installed the .net core 2.1.3 RC1 SDK from here: https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1
3) Updated all of my aspnetcore nuget packages to the latest version.
After doing both of these things, when I start my project I get this screen:
HTTP Error 502.5 - Process Failure Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit:
https://go.microsoft.com/fwlink/?LinkID=808681
and in my Output window from ASP.NET Core Web Server, I get this:
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\
- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.1.0-preview2-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
2.1.0-rc1-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\
- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.1.0-preview2-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
2.1.0-rc1-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
.NET Core 2.1 SDK will be released this week. If you can't wait until then, add this to your *.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RestoreAdditionalProjectSources>
https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-1/20180515-07/final/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
....
</Project>
And download the final SDK from: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.300/dotnet-sdk-2.1.300-win-x64.exe
For more details visit: https://github.com/aspnet/Home/wiki/2.1.0-Early-Access-Downloads
By updating all NuGet packages, you seem to have upgraded from the RC version you started out with (which is installed on your system) to the RTM version currently being released (and thus already available on NuGet but not installed on your system).
The Microsoft.AspNetCore.App NuGet packages are supposed to be referenced without a version so that the installed tooling can pick an appropriate version.
Update your .csproj file to remove the Version attribute and only reference that package through:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
.NET Core SDK 2.1.300 is now available: https://www.microsoft.com/net/download/windows Install it, this fixed the problem for me.
Looks like it's available on chocolatey now https://chocolatey.org/packages/dotnetcore-sdk/2.1.300
Not yet on the normal dotnet distribution sites. Crazy.
uninstall previous version
Download and install version 2.1 sdk
After the whole process reboot your PC
It should work.
I opened the Visual Studio installer, went to Individual Components, selected .NET Core 2.1 Runtime (LTS), and installed it.
Solved my problem.

need dotnet core 2.1 to show up in visual studio

When I try to upgrade ASP.NET Core in Nuget package manager, I get the following error:
Severity Code Description Project File Line Suppression State
Error Package Microsoft.AspNetCore.All 2.1.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.All 2.1.0-preview2-final supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1) 0
I have installed the sdk multiple times, so I'm confused because when I go to target it only has up to dotnet core 2.0 as an option. I installed visual studio preview but that hasn't helped either. Any suggestions?
For .NET Core 2.1 you need (currently) version 2.1.300-rc1 of the sdk. The version numbers of the SDK and .NET Core are not in sync, older 2.1 versions of the SDK are not enough.
This version can be downloaded from here: https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1
You can check the version on command line with donet --version command. dotnet --info will also list all the installed runtimes and SDKs.
> dotnet --version
2.1.300-rc1-008673

nuget get different versions swicth

I am trying to nuget the new 3.0 binaries for NServiceBus but they don't seem to be available in package manager.
Is there a switch to force nuget to get the latest available version?
The 3.0 line is in pre-release at the moment, so you'll have to do:
PM> Install-Package NServiceBus -Pre
At the time of this answer, it will install RC5.
The switch -Pre is short for -PreRelease, which will install a pre-release version if it's more recent than the latest stable. If a stable version is more recent, it will install the stable. See this NServiceBus page on nuget. For details on prerelease on nuget, see the versioning page.
You can also try the continuous integration (CI) package:
PM> Install-Package NServiceBus-CI