Why is package restore failing when I upgrade to ASP.NET Core 1.0.1? - asp.net-core

I am attempting to install ASP.NET Core 1.0.1 on my windows 7 dev box which already has ASP.NET Core 1.0 working in Visual Studio Community 2015 Update 3.
To accomplish this I installed .NET Core 1.0.1 - VS 2015 Tooling Preview 2 from https://www.microsoft.com/net/core#windows as indicated by https://blogs.msdn.microsoft.com/dotnet/2016/09/13/announcing-september-2016-updates-for-net-core-1-0/
I then updated several version numbers in my existing project.json file from 1.0.0 to 1.0.1 so that my web application would use the new 1.0.1 components.
As expected this triggers a package restore, but unfortunately it fails. I can't figure out why the packages restore is failing. Any help would be greatly appreciated.
Here are the errors from the output window:
Errors in C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\wwwGiftOasisResponsive.xproj
Unable to resolve 'Microsoft.AspNetCore.Server.IISIntegration (>= 1.0.1)' for '.NETFramework,Version=v4.5.2'.
PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe restore "C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive.vs\restore.dg"
log : Restoring packages for C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\project.json...
error: Unable to resolve 'Microsoft.AspNetCore.Server.IISIntegration (>= 1.0.1)' for '.NETFramework,Version=v4.5.2'.
log : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\project.json...
log : Writing lock file to disk. Path: C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\project.lock.json
log : C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\wwwGiftOasisResponsive.xproj
log : Restore failed in 2895ms.
Errors in C:\Users\Ron Clabo\Documents\Visual Studio 2015\Projects\wwwGiftOasisResponsive\src\wwwGiftOasisResponsive\wwwGiftOasisResponsive.xproj
Unable to resolve 'Microsoft.AspNetCore.Server.IISIntegration (>= 1.0.1)' for '.NETFramework,Version=v4.5.2'.
My understanding is that the upgrade from ASP.NET Core 1.0 to 1.0.1 is suppose to be pretty easy so I must be missing something simple but after hours of looking I could really use some advice.

You didn't read the upgrade instructions (and here) correctly.
This is not a global version bump. Only the listed packages were upgraded to 1.0.1. All remaining ASP.NET Core packages stay at 1.0.0, this includes Microsoft.AspNetCore.Server.IISIntegration.
The affected packages are:
Microsoft.EntityFrameworkCore
Microsoft.AspNetCore.Server.Kestrel
Microsoft.AspNetCore.Mvc
Microsoft.AspNetCore.Antiforgery
Microsoft.AspNetCore.Routing

Not every package got version bumped to 1.0.1. There is no 1.0.1 version of IIS Integration on nuget. That component should be left at 1.0.0 in your project.json.

Related

Correct .NET Core SDK to build netstandard20 library

I have a few libraries with target framework netstandard20. These libraries are consumed by a few .net framework 4.6.1 libraries.
The IT department uninstalled the .NET Core 2.0 from the build server because of some security vulnerability. All the libraries that use netstandard20 are now failing with the following error:
C:\bamboo6104...>nuget restore
MSBuild auto-detection: using msbuild version '16.11.2.50704' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\bin'.
C:\bamboo6104\xml-data\build-dir\BAM-CUS-JOB1...\netstandard\xxx.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
The Build Server already has Visual Studio 2019. What version of SDK need to be installed for the build to pass? I have the following SDKs on my laptop:
Will installing 2.1.526 version resolve the build issue?
I can't upgrade the libraries to .NET 5 or 6 due to we have numerous libraries with the same problem and upgrade is not a priority.

MsBuild failing for .Net Standard project with error "Package System.Security.Cryptography.ProtectedData, version x.x.x was not found"

Project Setup : Mixed framework solution
.Net Framework 4.6.2 projects in solution : 15
.Net Standard 2.0 projects in solution - 1
Development Machine
Visual Studio 2017(15.7.4) : Builds without any errors
Build Server
TeamCity Version 2017.1.3
Build Steps
Nuget Restore(3.4.4)
dotnet Restore
MSBuild( Build Tools 2017), Tools Version 15.0
Build fails with following error in the .net standard 2.0 project : [ResolvePackageAssets] C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package System.Security.Cryptography.ProtectedData, version 4.4.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
What's interesting is I can't find reference or use of System.Security.Cryptography.ProtectedData anywhere in the project. Any help is greatly appreciated.
P.S - Can't use dotnet build, as the solution needs building of licenses.licx files, and the component which builds it (Microsoft.Build.Tasks.LC) is not ported to .Net Core. The suggestion from various posts was to use MsBuild.exe

Error when installing NUnit 3.9 in Visual Studio 13 with NuGet

I am trying to install NUnit 3.9 in Visual Studio 13 Professional, but I am facing the below mentioned error while installing:
'NUnit' already has a dependency defined for 'NETStandard.Library'.
How do I solve this issue?
This error is often caused by the fact that your version of NuGet is too old. Try updating NuGet.
NUnit's most recent NuGet packages include .NET Standard builds, which mean NuGet client version 2.12 or later is required. From the next version of NUnit, you'll get a more helpful error message for this.
If you cannot upgrade Visual Studio to a newer version that includes newer versions of NuGet, you can install NUnit 3.5.0 which doesn't include .NET Standard. You can select the older versions from a dropdown in the user interface, or install from the Package Manager Console.
Install-Package NUnit -Version 3.5.0

'MySql.Data' already has a dependency defined for 'System.Text.Encoding.CodePages' [duplicate]

I'm trying to add AutoMapper as a dependency to a project using NuGet on Visual Studio Premium 2012, but it fails.
It says:
Operation failed
'AutoMapper' already has a dependency defined for
'Microsoft.CSharp'.
I'm able to add other dependencies.
I'm using the last version of the package manager for VS 2012:
NuGet Package Manager 2.8.60318.667
Any ideas what should I check?
The problem is that your NuGet Package Manager is too old. You need NuGet 2.12 since this supports the newer .NETStandard frameworks that the AutoMapper 5.0.1 NuGet package is using.
The AutoMapper has a group dependency which specifies a target framework of .NETStandard. Since your version of NuGet Package Manager is too old it does not recognise this target framework and converts it to an Unknown target framework and you end up with duplicate frameworks since there .NETStandard is used a few times in that NuGet package. This causes the error:
'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'
Unfortunately NuGet 2.12 is not available for Visual Studio 2012 but is available for Visual Studio 2013.
So either you need to update to Visual Studio 2013 or above, or you will have to use the older AutoMapper NuGet package which does not support .NETStandard.
Seems to be a problem with the current version of automapper:
AutoMapper 5.0.0 Tuesday, June 28, 2016
I tried with the previous version and it works:
PM> Install-Package AutoMapper -Verbose
Install-Package : 'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'.
At line:1 char:16
+ Install-Package <<<< AutoMapper -Verbose
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
PM> Install-Package AutoMapper -Version 4.2.1
Installing 'AutoMapper 4.2.1'.
Successfully installed 'AutoMapper 4.2.1'.
So, if you can't update NuGet Package Manager, the answer is:
PM> Install-Package AutoMapper -Version 4.2.1
I ended up needing to update NuGet.exe that was included in the solution to be able to build NuGet packages by running:
nuget.exe update -self
I had the same issue on VS2013. I had to update to VS2013 Update 5 and get the latest nuget distro for VS2013 at
https://dist.nuget.org/visualstudio-2013-vsix/v2.12.0/NuGet.Tools.vsix
Once that was done, I rebooted Visual Studio. After that I was able to use the Automapper 5.0.2 package
Go to Visual Studio > Tools > Extension and Updates
Find Updates in left accordion menu, Go to Visual Studio Gallery.
You will find a update for Nuget.
Update the nuget package and try installing or builing the project.
Thanks,
GT
An other workaround if you're stuck with VS2012 and the old Nuget version:
Find the Cache folder of VS 2012's Nuget Package Manager (with Tools - Options - Nuget Package Manager)
Open AutoMapper.5.x.x.nupkg with your favorite Zip Tool
Modify the file AutoMapper.nuspec - I simply deleted all dependencies except .NETFramework4.5
Add the cache folder as a Nuget source (also in Tools - Options - Nuget Package Manager)
Install Automapper either with the console or the GUI but make sure to choose first the newly added cache folder as package source.
Of course, the next version of Automapper probably needs to be adapted, too, in order to install it.
This looks like a mismatch between the .NET version used by the Automapper package and your project. Can you confirm the .NET version that your project is using?
Automapper 6.0.2 - nuget 2.8.8 gives this error. Needed to update to 3.4.4 to get this working.
Removed both CSharp and AutoMapper. Installed CSharp (4.0.0.0) first and then added Automapper (6.1.1.0). This resolved the problem for me.
I observed this exact problem when opening a project with Visual Studio 2010.
After opening with VS2017, I was able to install AutoMapper without any error.

Visual Studio 2017 .net core project give Restoring NuGet packages for bootstrapper error when adding wcf endpoint

With Visual Studio 2017 preview (latest version of VS 2017 Professional), in ASP.Net Core 2.0 project, I am trying to add a WCF service via Connected Services, and it gives the below error.
My teammate has the same project and it works on his computer but gives the below error on my pc. I cleaned the project, rebuild but the error is not fixed. What should I do? Is that error about WCF, or NuGet? I deleted and reinstalled NuGet but the error still occurs.
Importing web service metadata ... Number of service endpoints found:
1 Restoring NuGet packages ... Building solution ... Scaffolding
service reference code ... Restoring NuGet packages for bootstrapper
... Error:Error: Restoring packages for
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj...
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.Collections.Specialized (>= 4.0.1) but
System.Collections.Specialized 4.0.1 was not found. An approximate
best match of System.Collections.Specialized 4.3.0 was resolved.
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.ComponentModel.TypeConverter (>= 4.1.0) but
System.ComponentModel.TypeConverter 4.1.0 was not found. An
approximate best match of System.ComponentModel.TypeConverter 4.3.0
was resolved.
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.Linq.Expressions (>= 4.1.1) but System.Linq.Expressions 4.1.1
was not found. An approximate best match of System.Linq.Expressions
4.3.0 was resolved. C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: Unable to find package
System.ComponentModel.EventBasedAsync with version (>= 4.0.11)
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: - Found 1 version(s) in Microsoft Visual Studio
Offline Packages [ Nearest version: 4.0.10 ]
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: - Found 0 version(s) in SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Data.Common. No packages
exist with this id in source(s): Microsoft Visual Studio Offline
Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Net.WebSockets. No
packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Net.WebSockets.Client.
No packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Private.ServiceModel. No
packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.ServiceModel.Primitives.
No packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed Generating MSBuild file
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\obj\SvcUtilBootstrapper.csproj.nuget.g.props. Generating MSBuild file
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\obj\SvcUtilBootstrapper.csproj.nuget.g.targets.
Restore failed in 3,32 sec for
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj.
An error occurred while bootstrapping svcutil. This usually happens
when processing references. You might be able to work around this
problem by not providing reference parameters, and manually removing
any types redefined in the generated proxy code. Error:An unknown
error occurred while invoking the service metadata component. Failed
to generate service reference.
I change package source(tools->nuget package manager->manage nuget package
...) with nuget.org instead of visual studio package and it works
via:
http://yazilimsozluk.com/visual-studio-2017-net-core-projesine-wcf-eklemede-restoring-nuget-packages-for-bootstrapper-errorerror-restoring-packages-hatasi