-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found. - The following frameworks were found: 3.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] You can resolve the problem by installing the specified framework and/or SDK. The .NET Core frameworks can be found at: - https://aka.ms/dotnet-download #3487
Comments
I'm having a similar issue tying to build a Console output:
On the local Windows machine the same commands are working. |
Ignore my previous comment. The build pipeline was miss-configured and it was trying to analyze the project using SonarQube. |
Finally I resolved this problem!! |
I am facing the same issue . @roxxshivamsingh I did not understand here. So is this error because of mlnet tool only? I need to have dotnet core version 3.0 only. I dont want to downgrade it to 2.2.204 |
Hello @roxxshivamsingh , I understand the solution mentioned here is to remove 3.0 version all together and use 2.2.204 version to utilize But is there any work around to use dotnet version 3.0 without error? I am trying to use Any help would be appreciated . |
I don't think you need to uninstall or install any SDKs, only a .NET Core Runtime that can run the tool. I think the latest Runtime 2.2.x will do the trick: https://dotnet.microsoft.com/download/dotnet-core/2.2. |
I have the same issue. I have upgraded to version 3.x and now I get the mentioned error and the following output: |
Yes and me as well.. I have uninstalled all traces of Visual Studio as well as every possible SDK as well as dotnet. I cannot find for the love of god the place it refers to 2.2.0 yet it tries to use it here. Right now when I try and create a migration the whole process screws up and I end up having fake data that is missing the first records ID in every table... I think the first think is to make sure all is compatible etc but now I find this inconsistency and have no idea where its getting 2.2.0 when I have referenced 3.0.0 everywhere.. I even put in a global.json with SDK 3.0.100 and it STILL wants to go to 2.2.0. Quite frankly the reason you pick Microsoft's Visual Studio because it works but right now I am chasing my tail on this and wasting time I shouldnt be. Its not good enough. Why is it trying to use 2.2.0???
|
I'm running into what appears to be the same issue on CentOS 7:
|
You can also try installing .NET Core 3.0 using the following one liners: Docs: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script Unix Shell (Linux / WSL and macOS) curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -Channel 3.0 Windows PowerShell: [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 3.0 Windows cmd: @powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 3.0" |
I gave that a shot but exact same results. Is there an environment variable that needs to be set that points to .NET? Something equivalent to $JAVA_HOME? |
You have found a bug in the install script. Nice catch! 😅 If there is no sdk installed on a system (but only the dotnet-core runtime), curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin \
-Channel 3.0 --verbose | grep already shows:
(even after i deleted all sdks To workaround: |
Okay, so that didn't help. I ran So next I completely remove all traces of .NET Core using both Then I did some A quick reboot and then I ran Next up I ran my program again with the following results:
Crap!
You'll note that this time I have the SDK installed, not just the runtime. I don't know if it matters, but the app was compiled on Windows 10 with the following:
And on that machine
I'm at my wits end! |
It shouldn't matter; I just published a hello-world on Windows 10 and ran on WSL: (both Windows 10 and WSL Ubuntu are running dotnet ~\Source\Repos> dotnet new console -n myApp
~\Source\Repos> cd myApp
~\Source\Repos> dotnet publish --configuration Release --framework netcoreapp3.0 --runtime linux-x64 --self-contained False
~\Source\Repos> bash
adeel@Adeel-PC:/mnt/c/Users/adeel/Source/Repos/myApp$ bin/Release/netcoreapp3.0/linux-x64/publish/myApp
Hello World! Can you create and run a hello-world app on your CentOS? |
All right! Now I think we're getting somewhere!
|
How about: |
Googling with Bing found this: https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging Relocating So now that I've got the SDK on that box I'm going to try building it there and see what happens. |
Looks like this might be related. |
same problem here dotnet/installer#5287 |
@dagood @livarcocc @nguerrera can you help with this? |
This issue seems to have become a bit of a lightning rod for missing framework issues due to the title.
I'm closing this: the original issue doesn't have enough info to repro or understand the scenario, and the comments share a symptom but I don't see a significant common thread that's not addressed. Please do open a new issue if the above doesn't help, and if at all possible, do include a repro project and steps to make sure your individual problem is being addressed. |
I think I found a better way around it for myself: # Check your installed tools with $ dotnet tool list -g
$ dotnet tool uninstall dotnet-ef -g
$ dotnet tool uninstall dotnet-dev-certs -g # If you have it installed
$ dotnet tool install dotnet-dev-certs -g # If you had it installed
$ dotnet tool install dotnet-ef -g |
@dagood tl;dr: I'm searching for answers to three questions:
Background NoiseI wonder if the "migration tool" @si2030 is using is FluentMigrator.DotNet.Cli (or Microsoft's EntityFramework migration tool THIS is the set of questions that seem to be driving all the confusion, because in the old .NET Framework world, you could run a .NET 2.0 assembly on .NET Framework 4.0. MSDN states .NET Framework 4.6 is version compatible all the way back to .NET Framework 1.0 I found this brief MsDocs note from @Rick-Anderson stating:
...but then it's not clear to me what the scope of SetCompatibilityVersion is. Is it a .NET Runtime concept, is it specific only to ASP.NET Core, etc. Then I dug further, and found Select which .NET Core version to use, thinking I'd finally find my answer, but then realized that's for development, not for deployment. Then I dug further, and found .NET Core application deployment, but it made me wonder, have I been doing .NET Core for 3 years and not even realized what my deployment model is? I couldn't tell from the article what causes a Framework-Dependent Deployment vs. Self-Contained Deployment vs. a Framework-Dependent Executable. I just want to find the light switch, not see all the wiring going back behind the walls to my electrical panel, all the way to the power grid. I think this is why you muse correctly that these problem descriptions are vague - people want the light switch, not the "as built" blueprints for the whole house. Then I went to the Step-by-step examples linked at the bottom of the .NET Core application deployment page, and went to Publishing .NET Core apps with the CLI, and found this quote:
I think this is the answer to my questions above... but I'm not really sure. It doesn't definitively say, "John, get used to a world where .NET Framework no longer exists, and you need to stay on top of every single .NET release and re-build your last tagged release on GitHub with a minor incremental change of adding a new TargetFrameworks to your build." |
Take a look at https://github.com/dotnet/designs/blob/master/accepted/runtime-binding.md The default configuration for an application on .NET Core will not allow roll forward across a major version boundary, but it is possible to opt in with a different configuration. You can specify The doc shows the other values for this knob and many other details. It can also be specified as an environment variable or via a command line argument. Generally speaking there is no 100% guarantee that rolling forward across major versions will work. However, it is very likely to work, especially for typical simple command line tools. When you use this configuration it is expected that you are staying current with releases and at least testing that your app works. I still tend to prefer this to aggressively multi-targeting to all major versions as that will slow down your build and bloat your packages. Instead of adding a new TFM to my tool/app every time there's a new major version, I'd just opt in to less conservative roll forward and test that things still work without older runtimes installed. If there aren't any issues, then I wouldn't need to publish a new package at all. |
@nguerrera Thanks - I was searching everywhere for whether it was even possible.
To be honest, after spending the last few days thinking about what the right guidance is for open source developers, I think that:
Orthogonal Concerns:
|
I fixed this issue by downgrading the I'm guessing there's an issue in |
In case other folks find their way here from Google: Update: this is not the correct solution. Visual Studio was configured to run AnyCPU tests as x86, but only the x64 SDK was installed. I re-upgraded to |
@BrandonDusseau Please clear out all your bin and obj files and then try again. |
I don't want to spend a lot of space on this issue talking about it, since it's not exactly the same problem as the one originally reported, but it is relevant to the comment above mine. Unless something comes up, this will be my last comment on this issue. If you believe this information should result in a new issue being opened, let me know, although it's more of an issue with Visual Studio than with dotnet. I should add that this issue is specific to test projects. I removed the bin and obj files from all projects as you suggested, but the problem persisted. As of VS 16.4 it seems to default to running AnyCPU test projects as 32-bit, and so it tries to find 32-bit SDKs. Before the upgrade I had no 32-bit SDKs and the upgrade installed .NET Core 3.1.0 32-bit. I'm not sure what led VS to start trying to run tests with 32-bit SDKs, but it causes the following error:
As I mentioned in the comment above, the solution to this specific problem is to either set Test Explorer to run AnyCPU tests against the x64 architecture, or install the relevant 32-bit SDKs, or don't use AnyCPU as the platform target in the test projects. The first solution is probably the best. |
I solved the problem with the installation of the dotnet core SDK version that was not found, specifically the 2.1. Sorry for the bad English. |
dotnet tool install --global dotnet-ef For me, this worked 15 days back. But I'm again stuck since the availability of Version 3.1.2 |
@BrandonDusseau worked for me, this was a very misleading error as it was simply the tests were configured for x86 instead of x64. This however ate up a lot of my time trying to figure out why it was complaining about missing .Net Core 2.1 in my multitarget tests. |
I was trying to follow the IDS4 demo and was installing the http://docs.identityserver.io/en/latest/quickstarts/5_entityframework.html |
Yeah, I had to install the exact version of dotnet-ef that I have installed on my workstation in order to get things working properly. That seems wrong considering my SDK was a single patch away from the tools version I was trying to use... My environment:
With the above environment, I began following the docs here. When I ran "It was not possible to find any compatible framework version" I was able to get around the error by downgrading all packages and tools to 3.1.1. I expected newer versions to be backwards compatible with older versions (at least with the same major and/or minor version). Long story short; run |
This worked for me |
I run |
@Kaspary Your link is broken |
@jzabroski, sorry, now I adjusted |
Changing ${workspaceFolder}/bin/Debug/netcoreapp2.2 to ${workspaceFolder}/bin/Debug/netcoreapp3.1 in configurations=> program section in .vscode/launch.json on ubuntu with vscode fixed it for me |
For anyone coming up against similar issues to those documented above, .NET Core has a great story for forward compatibility, and it's documented. .NET's roll-forward support allows using newer frameworks with libraries linked to older frameworks. The workaround for build errors like:
was to update our builds to set environment variable - name: Build site
run: |
dotnet wyam build site
env:
DOTNET_ROLL_FORWARD: Major |
@johncrim That does not always work, as is the case when the Microsoft DI HostBuilder pattern changed from 2.0 to 3.1. So, while it is possible in theory, it is not always proven in practice. In your case, Dave Glick I believe switched from Wyam to Statiq. He still supports both, but I believe "Statiq is the future". Wyam in particular is packaged in an strange way that nuget.org doesnt understand. If your issue is that you are using a 2.1 global tool with a newer version of the framework, ideally you install a local tool instead that is specific to your solution and you download the SDK your solution needs. |
@jzabroski - certainly it's more reliable to use a framework version that the library was compiled against. As long as the newer versions of the framework are backward compatible with regard to the APIs being used, it will work. That's a big if, but .NET is generally quite good in the backward-compatible department. To your point, I would prefer not to use roll forward support in my own code base in production code - certainly building against newer versions of the framework is preferable. But for build tools or similar, where runtime errors are reported in build logs and fail builds, and logical errors are hopefully caught by automated tests and/or QA, and the build tool is unlikely to be updated and re-released soon, it's a good option. |
@johncrim Well, I hope your env variable for DOTNET_ROLL_FORWARD is inside a kubernetes pod / docker image so that no other apps see it... it will bite you one day. The alternative is to set a runtime config json so that you set the roll forward there. But, you may just want to read the porting guide for going from Wyam to Statiq: https://www.statiq.dev/web/porting-from-wyam |
Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: windows
Provide details about the problem you are experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.
The text was updated successfully, but these errors were encountered: