Adomdclient for dotnet core 2.2 - .net-core

I am using the unofficial ADOMD client
https://www.nuget.org/packages/Unofficial.Microsoft.AnalysisServices.AdomdClientNetCore/
It looks fine in my project that target dotnet core 3.1. However, it keeps on returning error when I use it on project that is targeting dotnet core 2.2.
The error received is "The operation was canceled."
Is it unsupported for dotnet core 2.2? Ia there anyway to make it works on dotnet core 2.2?

Since your question was posted, an officially maintained ADOMD.NET (Microsoft.AnalysisServices.AdomdClient) for .NET Core is available in preview on nuget. You can consider using this library instead of the unofficial library.

Related

ASP.Net Core WebApi Project creates an empty solution

I am trying to create a ASP.Net Core WebAPI application, i installed every sdk and runtime i was told to.
I then go into Visual Studio and create the Project from the ProjectCreator.
What I end up with is an empty solution and a project in the specified directory that i cannot open, with the error message the Project cannot be opened because it couldnt find a fitting sdk
(btw, creating it with .netCore3.1)
Heres a list of my installed sdks/runtimes:
.NET Core Runtime 2.1
.NET Core Runtime 3.1
.NET Core SDK 3.1.1
.NET Core SDK 3.1.4
.NET Runtime 5.0
.NET SDK 5.0.2
.NET SDK 5.0.3
ASP.NET Core 3.1.17
ASP.NET Core 5.0.8
This is what my solution explorer looks like tho the csproj is correctly placed
Whats seems to be the problem? Too many runtimes/sdk?
Are they overriding each other? Visual Studio cannot choose? I am baffled, this should work :/
[Edit1]
This is the guide I am following: https://learn.microsoft.com/de-de/aspnet/core/tutorials/first-web-api?view=aspnetcore-5.0&tabs=visual-studio
[Edit2]
I found a command that lets you see every sdk and runtime the dotnet/cli can access/see
(dotnet --info)
Looks like dotnet doesnt seem to find an sdk i installed
[Edit3]
I tried to manually install the .net core SDK 3.1 binaries into the C:\ProgramFiles\dotnet folder, but to no avail, dotnet --info still doesnt recognize the SDK
[Edit4]
I got it working, I will post the solution as an answer.
Heres what I did:
I uninstalled my Visual Studio IDE with the Visual Studio Installer
I uninstalled every .NET (Core) SDK and .NET (Core) Runtime
I did a fresh Visual Studio install with only the components i really need
After that I checked the dotnet --info command and there was it, 2 SDKs were installed. When I create the WebAPI Project now, the Solution Explorer has a project and I can finally see all files. This was weird. Thanks everyone tho!

How to run .NET framework project with VS Code, which has dependency of ReactJS?

I am beginner to .NET framework and ReactJS. I have a code repository which is .NET framework, with ReactJS dependency.
When I opened the repository, VS Code suggested me to install C# extension, I installed.
Now when I opened the main file abc.csproj; it automatically started installing packages.
It ended with message:
Finished
Failed to spawn 'dotnet --info'
and notified:
The .NET core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on path.
What is process and list of extensions if I need it to be ran in VS Code?
P. S. It is a .NET framework 4.5 project and not core .NET project
The C# extension no longer ships with an included Mono & MSBuild Tools...
If you still need Unity or .NET Framework support, you can set
omnisharp.useModernNet to false
in your VS Code settings and restart OmniSharp.
See issue #5120 for more details.
https://github.com/OmniSharp/omnisharp-vscode/issues/5120
it seems you don't have the .net framework SDK installed on your machine.
you can download and install .net sdk from here : https://dotnet.microsoft.com/download/visual-studio-sdks to be able to build .net framework projects
I will suggest to use Microsoft Visual Studio. I am using it and it's good and dragless rather than getting SDKs and having installation troubles.

Bamboo NuGet Restore command is running older version of SDK

I have a .net core 2.2 web app that has been building successfully in Bamboo for several months. Recently someone rebuilt the new Bamboo server (we're on premise, not in cloud) as the first step in a Bamboo upgrade and my build began failing. The error is:
C:\Program Files\dotnet\sdk\2.1.509\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
My original post incorrectly asserted that this error was occurring in a Script task running dotnet publish. I realize now that it is actually occurring in the previous task - a Bamboo Command task running NuGet Restore. And I can reproduce the problem at the command line, so it does not appear to be a Bamboo issue.
So, in summary, I have a .NET Core solution with four projects. All four projects target .NET Core 2.2. I have NuGet 5.3.1 installed on my Bamboo build server. I navigate to the solution directory and run
nuget restore
And I first get the following informational message:
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin'.
Followed by four instances of the following error, one per project:
C:\Program Files\dotnet\sdk\2.1.509\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
What is causing the nuget restore operation to be working with .NET Core 2.1 instead of 2.2? Is there a problem with the msbuild auto-detection?
I initially found that .net core 2.2 had not been installed on the new server, so I installed it, so both are now installedre. But the error above persists and continues to reference .net core 2.1.
Instead of running nuget restore use dotnet restore.
A cleaner way to set this up would be to configure a dotnet executable as a Command in Bamboo. By doing this you can ensure that you are running the correct executable every time. Additionally you will gain the following benefits:
The command will show what version it is
This scale to other build agents
Adds clarity to the Bamboo task (will show as dotnet 2.2 instead of a script).
Then you can have dedicated tasks for each step (e.g., restore, build, test)

which .NET SDK version project refer if there are multiple version installed on system?

I have 2.1.4 version of .NET SDK installed on the system but I was getting "The current .NET SDK does not support targeting .NET Core 2.1. target .NET Core 2.0 or lower or use a vs of the .NET SDK that support NET Core 2.1" error on opening an existing project.
Now I have installed 2.2.104 version for .NET SDK along with existing one. So which version of SDK my project is referring now, I'm not sure. Can someone please help on this.
Your confusion is probably because you think SDK 2.1.x (2.1.4) should be able to target .NET Core 2.1. That's unfortunately not true. As you can see on the .NET Core 2.0 download site, the .NET Core 2.1.4 SDK is for .NET Core 2.0!
If you want to target .NET Core 2.1, you need SDK version 2.1.300 or later. SDK 2.2.104 should be good enough for this.
If you have installed multiple .NET Core SDKs, the latest (the one with the highest version number) is the one used by default. You can run dotnet --info to see all the installed SDK and Runtimes. It will also tell if you if a global.json file is making .NET Core use another SDK instead of the latest. You can use a global.json file to force a different version of .NET Core SDK to be used.

The current .NET SDK does not support targeting .NET Core 2.1

Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1. Microsoft.AspNetCore.Identity.Test C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference
I try to build Microsoft sample https://github.com/aspnet/Identity/tree/dev/samples/IdentitySample.Mvc
I have installed Netcore SDK 2.1.4
dotnet --info shows 2.0.5
Why it shows error?
The dev branch always targets the latest nightly builds (2.1.0 pre-preview ones). Use one of the tags, such as the rel/2.0.0 branch which targets the ASP.NET Core 2.0.0. https://github.com/aspnet/Identity/tree/rel/2.0.0/samples/IdentitySample.Mvc.
.NET Core 2.1 is not out yet. An Preview 1 is expected later in Q1 and full release is expected in Q2.
For those stumbling upon this question in a more general context, the issue is that .Net SDK 2.1.4 doesn't support .Net Core 2.1.
.Net Core 2.1 is supported by SDK 2.1.300 and above.
Download here https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1
The confusion here comes from differences in the versioning between the CLI and .Net Core. The SDK version is actually the CLI version and that's not the same as the .Net Core version that's supported.
Thankfully there are plans to tidy this up and more info can be found in this GitHub discussion https://github.com/dotnet/designs/pull/29

Resources