-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The specified framework 'Microsoft.NETCore.App', version '2.0' was not found #8826
Comments
Can you share your project or a repro of this issue? |
Hi, Thanks for getting back to me. The project is pretty big so not practical to share, but since updating to 15.5.0 Preview 2.0, as well as not being able to create migrations due to what looks like core versioning issues, I can no longer publish anything to Azure as the build fails although it builds fine in VS? Whatever was changed with 15.5.0 Preview 2.0 looks to be creating a few issues. As the issue appears to be with a project built with the previous version of the Preview, then updating to 15.5.0 Preview 2.0 I'm now unable to repro. |
You can add a global.json pinning your SDK version to version 2.0.2 (the last release we did with VS 15.4) or 2.0.0. Just add the global.json file to the root of your repo with contents like this:
This should unblock you. But notice that your SDK will be pinned to whatever version you put there. Let us know if this unblocks you. It would also be super helpful if you could at least find a minimal repro for this problem. Is this happening on multiple machines? |
Could you share the contents of runtimeconfig.json file for your tool? And are you packaging it in your tool nupkg? |
Hello everyone. I have this problem too. |
@netbidev any chance you have a small repro for us? |
@livarcocc here The command here |
@netbidev That project replicates the error for me as well |
@livarcocc The workaround of adding a global.json file specifying 2.0.2 works for me. Does anyone know if/how the --fx-version argument could be used instead? global.json is tacky. |
the --fx-version argument is a host argument that can be used to indicate which runtime framework to use when running an application. Like this: |
I guess that the dotnet ef command can't be used with host arguments? I've tried putting --fx-version in various places in a command like dotnet ef migrations list without success. |
Hit this issue in an xunit test project too. Repro:
Actual:
Notes: |
I am having the same issue after upgrading to v15.4.4. The only solution I've found so far to fix the CLI tools issue it to add the RuntimeFrameworkVersion inside the property group as such:
|
I can't repro this using SDK 2.1.1-preview-007139 on a Mac or 2.1.1-preview-007165 on Windows. For those that are reproing this, is it always reproing on Windows? If so, can you make sure that you don't have two different dotnet versions installed, one x86 and one x64? And that the one being used by the tool is not being the wrong one? I mean, make sure that the right dotnet installation is coming before the other one in the path environment variable. |
I found that I had some preview versions of dotnet sdk installed, including |
I'm having the same issue ever since I upgraded to Visual Studio 15.4.4 which obviously included the sdk 2.0.3 |
Same issue here as @jeremymeng |
Microsoft recognized some of the errors of their ways and released new versions of the runtime and server hosting for 2.0.3 since my last post, and this has solved our deployment issue (not discussed this thread), but sadly, we still have to use the RunTImeFrameworkVersion tag in the project in order to use dotnet ef ... commands. We are also using a "Data project" and have isolated the context, etc. into this class lib, which uses a DesignTimeFactory for the context. I have not yet tested this behavior against a standard, template-generated web project, but will do so and report the results back here. |
Here's an update. If we leave the context and models in the same aspnet web core project generated by the template, we are able to run the CLI tools without the error. As soon as we extract the context and models into their own class lib, we are forced to use the RunTimeFrameworkVersion tag in order to use the CLI tools. Not sure why as this class lib code/technique was working fine until we upgraded to v15.4.4. |
@Kurtbaby any chance you can provide a repro project? On github or a zip? I would love to debug this issue. |
We have gotten a repro for this issue and understand it now. We are working on a fix for it. The best work around available to it right now is setting RuntimeFrameworkVersion in your library project targeting netcoreapp2.0. I will explain why this happens in a next comment when I get a chance. |
So, the issue here is that the SDK was setting the implicit version of the Microsoft.NETCore.App to 2.0 instead of 2.0.0. NuGet was then restoring using that and finding the closest available package. We then used that version to write the rutimeconfig.json file. In the cases where this repros, the libraries target netcoreapp2.0, but because they are libraries, no runtimeconfig.json is generated and EF ends up evaluating the RuntimeFrameworkVersion from the project and sees it as 2.0, which the host then does not understand, which leads to the failure here. This works for apps because in that case we do generate a runtimeconfig.json and use that to run EF. The real fix here is really just changing the implicit version from 2.0 to 2.0.0. |
@livarcocc can that be done without waiting for fixed packages? eg: using global.json? |
I have this issue as well after upgrading to VS 15.4.4 The property group fix by @Kurtbaby fixes it for me as well.
I am adding it before running |
Workaround (EF Tools)Adding the following to the project should also make it work. <PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup> |
The |
Sorry, can't speak for xUnit.net... Updated. |
@bgrainger I would suggest filling an issue under xunit itself for this. They may have to do the same fix there that we are doing in EF. The fix that we can make on the SDK side won't really fix the problem for tools if they are using the --fx-version option of the host to specify a runtime. |
|
The issue is closed but the bug seems to still exist. I'm experiencing this issue with latest Visual Studio 2017 (15.5.6) note: dotnet xunit will discover and run tests after RuntimeFrameworkVersion is added A sample project that repos this issue with just an xUnit and UnitTest project is attached. .NET Command Line Tools (2.1.4) Product Information: Runtime Environment: Microsoft .NET Core Shared Framework Host Version : 2.0.5 |
Currently have |
@mlorbetske for the template question. |
@mlorbetske First I must apologize, replied to the wrong issue. But nonetheless, you made my day! I was able to create a new project using the console and then build it in VS2017 :) |
I'm having this problem as well. "dotnet --version" is 2.1.4. I am using Visual Studio Enterprise 2017. |
@DiginessForever which version do you have? (dotnet --info) |
2.1.4 (updated my comment above). |
@DiginessForever I'm running a preview build |
One of my issues is that I have my data layer in a separate project (all the layers, App, Domain, Repository, and Data are in separate projects). The data layer is a class library. |
Have you tried adding a global.json file to you data project? |
We had this same problem for developers who only had the "Microsoft .NET Core SDK - 2.1.x" installed but did not have a 2.0.x version of the SDK installed. The solution (work-around, really) was to go the the archive downloads and install the latest 2.0.x SDK version (which can live side by side with 2.1.x). |
@tiwilson7 Thanks for that. I just built a new machine (only has the latest SDK installed) and got everything up and running except xunit CLR. It doesn't work even with |
@rfuhrer did you find a solution? same problem here |
@jlanng install the old 2.0.3 SDK and then force it to run that sdk using the command I actually ended up not really using |
The global.json with 2.1.4 does not help when using dotnet ef commands in a classlib. You still have to manually add the RuntimeFrameworkVersion to the CSPROJ file on all projects in the solution. If you only add to one NUGET wants to consolidate because some projects are using 2.0.0 and only the ones specified with RuntimeFrameworkVersion use 2.0.5. I only have SDK 2.1.4 installed why does it just not use Runtime 2.0.5 by default?
|
Note that it is the Microsoft .NET Core Shared Framework Host framework version not the .NET Command Line Tools version that you need to use in the -fx argument (2.0.5 in the below, NOT 2.1.4) `PS G:\MyFirstUnitTests> dotnet xunit
Product Information: Runtime Environment: Microsoft .NET Core Shared Framework Host Version : 2.0.5 PS G:\MyFirstUnitTests> dotnet xunit -fxversion 2.0.5 |
Any clear solution to this issue? I am running on OSX using dotnet from the CLI:
`
` I have tried some of the proposed workaround but no way. |
I too have this issue. I think it was caused either when uninstalling preview-2 and installing preview-3. I no longer have a |
All,
I've figured something out regarding transactions on the latest preview
nuget package (preview2).
I could not get the TransactionScope working, but have successfully gotten
CommittableTransaction working.
Here's a doc link:
https://docs.microsoft.com/en-us/ef/core/saving/transactions (look near
the bottom for the code sample I used to get going)
They are still working on TransactionScope apparently (System.Transactions
is not fully supported the best I can tell in the sqlclient package yet).
Regards,
Jacob
…On Sat, Apr 14, 2018 at 5:48 PM, Michael Brown ***@***.***> wrote:
I too have this issue. I think it was caused either when uninstalling
preview-2 and installing preview-3. I no longer have a
2.1.0-preview2-final directory in C:\Program Files\dotnet only
2.1.0-preview1-26216-03 and launch using IIS Express anymore because of
this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/dotnet/cli/issues/7901#issuecomment-381368788>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOIMLAt42A7lc_k4Nf1TwLQVM75bNp2Fks5toorIgaJpZM4QFwFD>
.
|
Hey guys,
You might try this:
Try changing the targeted framework to .net standard manually in the
project file.
https://docs.microsoft.com/en-us/dotnet/standard/frameworks
I don't know if that will work, but in our projects we have some .NET 4.7
projects and some .NET Core 2.0 ones. T
The only way to have a .NET 4.7 dependency is to change the .NET Core 2.0
project files manually to target .NET Standard.
Regards.
…On Tue, May 29, 2018 at 5:14 AM, Radenko Pavlovic ***@***.***> wrote:
Error
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '1.0.0' was not
found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '1.0.0'.
Dotnet tools
.NET Command Line Tools (2.0.3)
Product Information:
Version: 2.0.3
Commit SHA-1 hash: 12f0c7e
<dotnet/cli@12f0c7e>
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.3\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
Problem
Hey guys, I have similiar problem, I can not publish my .net core
application because dotnet bundle fails.
I have followed advices from this issue and I downgraded my SDK to 2.0.3
as it was pointed out.
I added <RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion> to my
project files too.
But still I am not able to publish as the error keeps occurring.
Some help would be great.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/dotnet/cli/issues/7901#issuecomment-392725918>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOIMLBFOnyQOVRJxdGOjk-Z9VhkxfVaUks5t3R-FgaJpZM4QFwFD>
.
|
Wow guys,
|
NOTE: the XUnit libraries have another dependency runtime dependency that is not called out specifically: System.Text.Encoding.CodePages I had to add that to my test project and use |
|
Not sure if this is a cli issue or VS so happy to move to another area if not correct
Steps to reproduce
Update to Visual Studio Professional Preview (v 15.5.0 Preview 2)
Try to add data migration (using IDesignTimeDbContextFactory)
dotnet ef migrations add [MigrationName]
Expected behavior
Migration created
Actual behavior
Error message
The specified framework version '2.0' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.0' was not found.
\
Environment data
Product Information:
Version: 2.1.1-preview-007094
Commit SHA-1 hash: f657648
Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.1-preview-007094\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
The text was updated successfully, but these errors were encountered: