NetCore project does not publish, keeps giving error of versioning mismatch - visual-studio-2017

I have a asp.net core project and it's supporting libraries all in .net core version 2.2. They run, I can debug, they also work in release mode. However when I try to publish them, I get a list of errors. The main cause is shown as the web project:
Error NU1202: Package Microsoft.NETCore.App 2.2.0 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package Microsoft.NETCore.App 2.2.0 supports: netcoreapp2.2 (.NETCoreApp,Version=v2.2)
after which this error keeps repeating for every project that the web project references/uses in the solution.
I have verified the dependencies and here's what I see in the web project:
and this:
as you can see the project references the latest version 2.2.0. So I have no idea where is it picking this netcoreapp2.1?
if that is the problem with configuration, why this error does not show up during debug and release build or even debugging. Just to note my publish is based on Release build and it uses netcore 2.2 as framework dependent.
This is what I get if I run dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview-18579-0056 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview-27122-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-alpha-27128-4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

The issue is likely to do with your publish settings in Visual Studio. You have two ways of fixing the issue.
Option A. Edit the file FolderProfile.pubxml under the folder \Properties\PublishProfiles directly and change the target framework from 2.1 to 2.2 under:
<TargetFramework>netcoreapp2.2</TargetFramework>
or
Option B. Go to publish menu and click Configure... It appears that just going to menu and clicking save will fix the issue since the menu defaults to the the project default 2.2.
Hope this fixes your problem.

I think that your installed runtime is .net core hosting 2.1.
You should download the dotnet runtime 2.2 or higher version.

Related

Failed to install from NuGet package manager - VS 2017

After installing vs 2022 and uninstalling it (because it doesn't support ODT - oracle developer tools).
Going back to the previous version (2017 or 2019) causes the NuGet package manager fails to install packages properly (all packages).
I've tried to install (for example) Newtonsoft.Json but it failed with the following error:
Error Install Log
I have tried to reinstall to NuGet package manager.
I have tried to reinstall VS (both 2017 and 2019).
Any help\ suggestions will be appreciated.
Thanks, Asaf

CentOS - Has AspNetCore.App 5.0.6 but needs AspNetCore.App 5.0.0

I am trying to run a .NET 5 console application (developed on Windows) in a docker container on CentOS 7.
I have the following:
[root#AU4RLBNAGV04A KLM Releases]# dotnet --list-runtimes
Microsoft.AspNetCore.App 3.1.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.15 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
But I get this error when I run the container:
[root#AU4RLBNAGV04A KLM Releases]# docker logs klmcontainer
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '5.0.0' was not found.
- No frameworks were found.
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=x64&rid=debian.10-x64
I tried to install version 5.0.0, but I get this error:
[root#AU4RLBNAGV04A KLM Releases]# sudo yum install aspnetcore-runtime-5.0.0
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package aspnetcore-runtime-5.0.0 available.
Error: Nothing to do
How can I resolve this?

cannot install amazon.lambda.tools

I have a created a simple AWS Dotnet core API in visual studio and now I need to install Amazon.Lambda.Tools 3.1.1 NuGet package But, whenever I try to install this NuGet package I get this error
The error:
Package 'Amazon.Lambda.Tools 3.1.1' has a package type 'DotnetTool' that is not supported (Project name)
I am running VS 2017(15.9.3) on Windows 10 and Dotnet core 2.1.500
Any ideas!!
I was able to solve it by adding
Amazon.Lambda.Tools to csproj and then deleting Microsoft.AspNetCore.All from csproj

Windows 10 - vagrant plugin install vagrant-aws - The "libxml2" package isn't available. (RuntimeError)

Trying to install aws plugin for vagrant. Getting a dependency error.
Logs show...
find_executable: checking for xml2-config... -------------------- no
--------------------
"pkg-config --exists libxml2"
package configuration for libxml2 is not found
Console output:
C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
ERROR: Failed to build gem native extension.
current directory: C:/Users/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4/ext/ovirtsdk4c
C:/HashiCorp/Vagrant/embedded/mingw64/bin/ruby.exe -r ./siteconf20181002-19764-xj4q7a.rb extconf.rb
checking for xml2-config... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/HashiCorp/Vagrant/embedded/mingw64/bin/$(RUBY_BASE_NAME)
--with-libxml2-config
--without-libxml2-config
--with-pkg-config
--without-pkg-config
extconf.rb:29:in `<main>': The "libxml2" package isn't available. (RuntimeError)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Users/jkittell/.vagrant.d/gems/2.4.4/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Users/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4 for inspection.
Results logged to C:/Users/jkittell/.vagrant.d/gems/2.4.4/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/gem_make.out
PS C:\Users\jkittell\Documents\Schedule3>
I did a google search and found a hotfix for this.
Gem file available here.
Just do a vagrant plugin install ~/PATH/TO/vagrant-aws-0.8.0.gem
I had to install fog-aws plugin first and then it worked.
vagrant plugin install fog-aws
Console output:
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Fetching: iniparse-1.4.4.gem (100%)
Fetching: fog-core-2.1.2.gem (100%)
Fetching: fog-aws-3.3.0.gem (100%)
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies fog-aws (= 2.0.1) and fog-aws (~> 3.0)
Activated fog-aws-3.3.0
which does not match conflicting dependency (= 2.0.1)
Conflicting dependency chains:
vagrant-aws (= 0.8.0), 0.8.0 activated, depends on
fog-aws (~> 3.0), 3.3.0 activated
versus:
fog-aws (= 2.0.1)
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install fog-aws
Installing the 'fog-aws' plugin. This can take a few minutes...
Successfully uninstalled dry-inflector-0.1.2
Successfully uninstalled fog-aliyun-0.3.2
Successfully uninstalled fog-atmos-0.1.0
Successfully uninstalled fog-aws-2.0.1
Successfully uninstalled fog-brightbox-0.16.1
Successfully uninstalled fog-cloudatcost-0.1.2
Successfully uninstalled fog-core-1.45.0
Successfully uninstalled fog-digitalocean-0.4.0
Removing console
Removing setup
Successfully uninstalled fog-dnsimple-1.0.0
Successfully uninstalled fog-dynect-0.0.3
Successfully uninstalled fog-ecloud-0.3.0
Successfully uninstalled fog-google-0.1.0
Successfully uninstalled fog-internet-archive-0.0.1
Successfully uninstalled fog-joyent-0.0.1
Successfully uninstalled fog-local-0.6.0
Successfully uninstalled fog-openstack-0.3.6
Successfully uninstalled xml-simple-1.1.5
Installed the plugin 'fog-aws (3.3.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3>
Try using:
vagrant plugin install fog-aws
vagrant plugin update
vagrant plugin install vagrant-aws
This should upgrade fog to a version 3.5 or greater

npm install -g ionic#latest is not upgrading to ionic 3.0.1

After installation i still don't see 3.0.1
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.2.1 Build version 8C1002
ionic install -g ionic#latest installs the latest ionic-cli package. This is version 2.2.3 currently as is also shown by your output of ionic info.
Just run
ionic start myapp [template]
You will notice the current ionic-angular version to be 3.x in the project's package.json.