-
Notifications
You must be signed in to change notification settings - Fork 3.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
EntityFramework.Tools Mac OSX 10.21 #7143
Comments
NuGet currently doesn't support installing .NET CLI Tool packages. You need to manually edit the project.json to register it... "tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
}, |
Closing as I think I have answered this, but reply if not and I will reopen. |
Thanks will try it out! |
Since I'm running Visual Studio for Mac I added it to <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet">
<Version>1.1.0-preview4-final</Version>
</PackageReference> The file Well enough rambling: it still doesn't work.
So I found a package.json file and included it as well and added the tools section. Currently this is my package.json (probably completely incorrect)
The output from
Where those 193 packages went I've no idea and for what reason they were even installed I don't understand (perhaps the different frameworks dnxcore,dnx,portable and so on that is not part of .netstandard1.1 that my app is targeting) Anyhow: it still doesn't work. Any clues? What is the plan for .csproj and project.json? Will both be needed when running Visual Studio for Mac? .csproj
|
@rowanmiller Do you have any ideas what might be wrong? Don't know what to try next - running out of ideas |
For preview3 (csproj-based) tooling, you'll need to add the following. <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet">
<Version>1.0.0-msbuild1-final</Version>
</DotNetCliToolReference> |
Also, I don't think the 1.1 runtime is supported on the preview3 tooling. At the least, you'll probably need to add the following package references. But even then it still may not work. <PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<Version>1.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
<Version>1.0.0-msbuild1-final</Version>
</PackageReference> |
@bricelam That did the trick. Unfortunately after running it the first time I can't run Edit After running the tool the reference Edit2 There is a file added to VS for Mac with the name |
Yep. Definitely still a preview. Personally, I'm surprised to hear that VS for Mac works at all with MSBuild .NET Core projects. |
It doesn't work as well as one had hopped though :). Struggling with referencing a Core class library (netstandard1.6) in my asp.net core web (.netcoreapp1.1). Referencing it directly make it compile but then the assembly file cannot be found. Tried to add it to my "local nuget feed" and install it but that fails since it wants to upgrade the tooling (but fails). Third try adding it to .csproj directly and performing |
any luck adding "Microsoft.EntityFrameworkCore.Tools.DotNet" on visual studio for mac? I am using dotnet version 1.0.0-preview3-004056 |
@vivek306 Yes! Paste below in ItemGroup
The CLI-reference will show up as missing in solution explorer (at least for me) and dont remove it since the reference will be removed. |
Great that works :).. did u have issues with AddUserSecrets? it pops up with parameter less error for ApplicationDBContext but EF works as it should when I comment that. |
Havent used that tool. Can check during the day if i can get it to work. What version are you using? |
it seems, what i came across is a know issue (https://stackoverflow.com/questions/40858155/ef-core-1-1-to-webapi-core-add-migration-fails) not related to EF. using the dotnet preview 3 with 1.1 runtime |
For EntityFrameworkCore 2.0, I added the following line similar to what bricelam told above. It worked fine.
But, It will show-up a warning. Thats ok.
Thanks! |
@technicalganesh - The package version is 2.0.0 (aligned with other EF Core packages) instead of 2.0.0-msbuild1-final. |
If you are using Visual Studio 2017, actually you dont need "Microsoft.EntityFrameworkCore.Tools.DotNet" |
Steps to reproduce
The issue
Trying to install tooling do run
dotnet ef
commandsRetrieving package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.1.0-preview4-final' from 'nuget.org'.
Install failed. Rolling back...
Package 'Microsoft.EntityFrameworkCore.Tools.DotNet.1.1.0-preview4-final' does not exist in project 'App'
Executing nuget actions took 620.74 ms
Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.1.0-preview4-final' has a package type 'DotnetCliTool' that is not supported by project 'App'.
Further technical details
EF Core version: 1.1.0
[assembly: AssemblyFileVersion ("1.1.0.21115")]
[assembly: AssemblyInformationalVersion ("1.1.0-rtm-22752")]
Operating system:
Visual Studio for Mac OSX 10.12.21
Other details about my project setup:
dotnet --version 1.0.0-preview3-004056
sdk 1.0.0-preview3-004056 (/usr/local/share/dotnet/sdk
The text was updated successfully, but these errors were encountered: