I have installed .Net Core 3.1.300 with asdf-vim and was following csharp tutorial. When i run:
dotnet new console -n BranchesAndLoops -o .
it does use a lot of memory. Is this the norm in C# world? Or have misconfigured something as a dotnet newbie?
❯ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.300
Commit: b2475c1295
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /Users/ogirginc/.asdf/installs/dotnet-core/3.1.300/sdk/3.1.300/
Host (useful for support):
Version: 3.1.4
Commit: 0c2e69caa6
.NET Core SDKs installed:
3.1.300 [/Users/ogirginc/.asdf/installs/dotnet-core/3.1.300/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.4 [/Users/ogirginc/.asdf/installs/dotnet-core/3.1.300/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.4 [/Users/ogirginc/.asdf/installs/dotnet-core/3.1.300/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Even though, I had installed dotnet with asdf-vm, later I had downloaded both the Visual Studio for Mac and Visual Studio Code (installed additional stuff, which I have no idea what they are) to try them rather than tinkering my vimrc.
Probably using both asdf-vm and Visual Studio for Mac caused some internal problems, which made dotnet to get stuck in a hanging status with gradually increasing memory leak.
After uninstalling VS for Mac and VS code, the high memory problem stopped occurring again.
Related
I have the dotnet installed in my machine with asdf, and even the asdf use the dotnet-install.sh (this is in code of install of dotnet), the DOTNET_ROOT work with the . ~/.asdf/plugins/dotnet-core/set-dotnet-home.zsh set (tested with echo in terminal), and the dotnet work and find the sdk (dotnet --info):
.NET SDK (reflecting any global.json):
Version: 5.0.300
Commit: 2e0c8c940e
Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /home/caneladeouro/.asdf/installs/dotnet-core/5.0.300/sdk/5.0.300/
Host (useful for support):
Version: 5.0.6
Commit: 478b2f8c0e
.NET SDKs installed:
5.0.300 [/home/caneladeouro/.asdf/installs/dotnet-core/5.0.300/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.6 [/home/caneladeouro/.asdf/installs/dotnet-core/5.0.300/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.6 [/home/caneladeouro/.asdf/installs/dotnet-core/5.0.300/shared/Microsoft.NETCore.App]
The Visual Studio Code don't recognized the Sdk of dotnet in folder saying that don't have any .NET Sdk:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
The C# VSCode Extension try to find the default dotnet instalation path and don't find, in this case you need to point manually the path to sdk with some environment variables in .NET Documentation. You must define all these variables below in terminal script initialization (such bashrc, zshrc) and show the path to asdf .NET Sdk installation , but can be used to another location, just change the path:
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=$(echo $HOME/.asdf/installs/dotnet-core/5.0.300/sdk/*/Sdks)
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER=5.0.300
export DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$(echo $HOME/.asdf/installs/dotnet-core/5.0.300)
And yes the Sdk folder is inside the Sdk folder, I confuse too (This take more time to resolve).
I am running a command during a AWS CodeBuild in order to build a lambda zip file.
The command is as follows:
dotnet lambda package --framework netcoreapp2.1 -o ../../artifacts/Jobs.zip
Here is the error:
**A fatal error occurred, the required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/root/.dotnet/tools/.store/amazon.lambda.tools/3.3.1/amazon.lambda.tools/3.3.1/tools/netcoreapp2.1/any/].
If this is a framework-dependent application, install the runtime in the default location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location.
Makefile:28: recipe for target 'Jobs/artifacts/Jobs.zip' failed**
Because this is a container I have printed out the dotnet info:
.NET Core SDK (reflecting any global.json):
Version: 2.2.402
Commit: c7f2f96116
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /root/.dotnet/sdk/2.2.402/
Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26
.NET Core SDKs installed:
2.2.402 [/root/.dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.7 [/root/.dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.7 [/root/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [/root/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.7 [/root/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [/root/.dotnet/shared/Microsoft.NETCore.App]
So the project in Visual Studio is targeting .NET Core 2.1
This issue just started about 10 days ago. I was able to go back to an earlier commit, push it to GitHub which kicks of the code build in AWS. This earlier commit, when pushed 2 weeks ago was successful and I did not see this libhostfxr.so error. Basically anything I push now I get the above error.
While researching I found that because I am using a Container, I can use the flag
--self-contained=true and /p:PreserveCompilationContext=true
so that I can bundle all dependencies but that has not worked either.
Not sure what else to try at this point. Does anyone have any ideas? The target framework for these lambdas is .NET core 2.1.
After more research I found the solution here. https://github.com/aws/aws-codebuild-docker-images/issues/321
I need to set the DOTNET_ROOT in my yml file.
I'm using xunit, with trait attributes set on some of my tests. When running dotnet test I'm trying to filter by these traits. I have it working fine locally on my Windows machine but when I run the same command on my CI container then it doesn't filter my tests.
The command is:
dotnet test --filter Category=Integration
I'm using CircleCI with the container mcr.microsoft.com/dotnet/core/sdk:2.2
When I SSH to the box and try running the command, it just runs all of the tests.
dotnet --info from the container:
.NET Core SDK (reflecting any global.json):
Version: 2.1.700
Commit: c2ef055a0f
Runtime Environment:
OS Name: debian
OS Version: 9
OS Platform: Linux
RID: debian.9-x64
Base Path: /usr/share/dotnet/sdk/2.1.700/
Host (useful for support):
Version: 2.1.11
Commit: d6a5616240
.NET Core SDKs installed:
2.1.700 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I've managed to resolve my issue just about. It appears it's a bug with the 16.1.0 SDK version (which dictates the version of vstest). As the issue was just on CI for me, I pinned the container I was using to
mcr.microsoft.com/dotnet/core/sdk#sha256:d0a71e1312be2618f320a7b7cc6d7423af3810542b3ffd35438108800ecfb958
which contains the 16.0.1 SDK. It's not the perfect fix but resolves my immediate issue.
i am struggling to both understand and get the Jenkins SonarQube MSBuild to analyse a dotnet core c# project and hoped someone could help out with it. I am able to run the scan using the following commands in an "Execute Shell" build step:
dotnet sonarscanner begin /k:"xxx" /n:"xxx" /v:"xxx"
dotnet build xx.sln --configuration Release
dotnet sonarscanner end
my current setup is:
Jenkins Server running on Amazon linux, on which i have installed jenkins (version 2.150.2) dotnet core and the sonarqube msbuild plugin
[jenkins#jenkins_qa sonar]# dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.104
Commit: 73f036d4ac
Runtime Environment:
OS Name: amzn
OS Version: 2
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.2.104/
Host (useful for support):
Version: 2.2.2
Commit: a4fd7b2c84
.NET Core SDKs installed:
2.1.4 [/usr/share/dotnet/sdk]
2.2.104 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
sonarqube server is installed on an Amazon Windows Instance.
I would like to use the plugin to run the analysis as this will include the report on the jenkins ui.
Thanks in advance
I have .net core 2.1 installed as you can see as follows;
➜ Util.Samples.Webs git:(master) ✗ dotnet --version
2.1.200
➜ Util.Samples.Webs git:(master) ✗
When I run visual studio to run this project.
I get an error:
Restore failed for 'Microsoft.NETCore.App (>= 2.1.0)'.
Restore failed.
When I look at options of the project. I see .NET core 2.1 (Not installed) but it is installed as you see above.
I tried changing TargetFramework in my .proj file but no luck.
Should I restart my Mac just like restarting Windows? How can I resolve this?
Here is dotnet --info output:
➜ Util git:(master) ✗ dotnet --info
.NET Command Line Tools (2.1.200)
Product Information:
Version: 2.1.200
Commit SHA-1 hash: 2edba8d7f1
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.13-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.200/
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
➜ Util git:(master) ✗
Looks like you were a victim of .NET Core's rather bizarre versioning scheme. In this scheme, the SDK and Runtime have different versions that were diverging, but still close enough to be confusing. In your case, you have now seen a SDK 2.1 that can not target .NET Core (Runtime) 2.1. This was "fixed" (some discussion here), but the upshot is the versions are still confusing and dotnet --info is your best best to find out which SDK and Runtime versions are supported by your installation of .NET Core.
You are trying to build a netcoreapp2.1 (aka .NET Core 2.1) project. You need an SDK that knows about it.
But the SDK you have (which is version 2.1.200) is actually an older SDK that does not know about .NET Core 2.1! The SDK versions that know about .NET Core 2.1 are versioned 2.1.300 or later. You need a newer .NET Core SDK version, which will include a more recent .NET Core Runtime 2.1 version as well.
You should have a good enough version of .NET Core if dotnet --info says something about "2.1" in a "runtime" section.