Unable to install MySql.Data.EntityFrameworkCore into .NET Core App - asp.net-core

When trying to install the 'MySql.Data.EntityFrameworkCore' package, I get the following error:
Microsoft (R) Build Engine version 15.1.548.43366 Copyright (C)
Microsoft Corporation. All rights reserved.
Writing /tmp/tmpiXrULm.tmp info : Adding PackageReference for
package 'MySql.Data.EntityFrameworkCore' into project
'/media/xxx/xxx.csproj'. log
: Restoring packages for
/media/xxx/xxx.csproj...
info : CACHE
https://api.nuget.org/v3-flatcontainer/mysql.data.entityframeworkcore/index.json
error: Unable to resolve 'MySql.Data.EntityFrameworkCore' for
'.NETCoreApp,Version=v1.1'.
error: Package
'MySql.Data.EntityFrameworkCore' is incompatible with 'all' frameworks
in project
'/media/xxx/xxx.csproj'.
I'm targeting Asp.NetCore 1.1.1
Is this the correct MySql EF package for .NET core?

Install given nuget package using package manager console:
Install-Package MySql.Data.EntityFrameworkCore -Version 8.0.9-dmr
OR
Using .NET CLI:
dotnet add package MySql.Data.EntityFrameworkCore --version 8.0.9-dmr
Then add this to .csproj file and restore your project:
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.8-dmr" />

Related

dotnet bundle not working in .net core mvc application

I try to use bundleconfig.json, which is standard added to the project when I started the project. I read every where they say you have to run
dotnet bundle
But this is not working for me I get the error
No executable found matching command "dotnet-bundle"
Now I Googled and found that I have to add this in Project.json
"tools": {
"BundlerMinifier.Core": "2.2.281",
But I have no Project.json file only csproj. I thought I have to install package. So I installed BundlerMinifier.Core but still same error.
What do I have to do so I can run the code and bundle my files?
According to https://learn.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification?view=aspnetcore-2.1&tabs=netcore-cli%2Caspnetcore2x you have to install the CLI tools for dotnet to do this.
From a command line in the project directory it looks like you do this:
dotnet add package BuildBundlerMinifier
dotnet build
and you should get this result
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Bundler: Begin processing bundleconfig.json
Bundler: Done processing bundleconfig.json
BuildBundlerMinifierApp -> C:\BuildBundlerMinifierApp\bin\Debug\netcoreapp2.0\BuildBundlerMinifierApp.dll
The linked page also talks about ad-hoc bundling. Its on the microsoft site so it shouldn't go anywhere.

Visual Studio 2017 .net core project give Restoring NuGet packages for bootstrapper error when adding wcf endpoint

With Visual Studio 2017 preview (latest version of VS 2017 Professional), in ASP.Net Core 2.0 project, I am trying to add a WCF service via Connected Services, and it gives the below error.
My teammate has the same project and it works on his computer but gives the below error on my pc. I cleaned the project, rebuild but the error is not fixed. What should I do? Is that error about WCF, or NuGet? I deleted and reinstalled NuGet but the error still occurs.
Importing web service metadata ... Number of service endpoints found:
1 Restoring NuGet packages ... Building solution ... Scaffolding
service reference code ... Restoring NuGet packages for bootstrapper
... Error:Error: Restoring packages for
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj...
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.Collections.Specialized (>= 4.0.1) but
System.Collections.Specialized 4.0.1 was not found. An approximate
best match of System.Collections.Specialized 4.3.0 was resolved.
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.ComponentModel.TypeConverter (>= 4.1.0) but
System.ComponentModel.TypeConverter 4.1.0 was not found. An
approximate best match of System.ComponentModel.TypeConverter 4.3.0
was resolved.
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: warning NU1603: dotnet-svcutil 1.0.0-preview-11010-660 depends on
System.Linq.Expressions (>= 4.1.1) but System.Linq.Expressions 4.1.1
was not found. An approximate best match of System.Linq.Expressions
4.3.0 was resolved. C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: Unable to find package
System.ComponentModel.EventBasedAsync with version (>= 4.0.11)
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: - Found 1 version(s) in Microsoft Visual Studio
Offline Packages [ Nearest version: 4.0.10 ]
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1102: - Found 0 version(s) in SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Data.Common. No packages
exist with this id in source(s): Microsoft Visual Studio Offline
Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Net.WebSockets. No
packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Net.WebSockets.Client.
No packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.Private.ServiceModel. No
packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj
: error NU1101: Unable to find package System.ServiceModel.Primitives.
No packages exist with this id in source(s): Microsoft Visual Studio
Offline Packages, SvcUtilLocalFeed Generating MSBuild file
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\obj\SvcUtilBootstrapper.csproj.nuget.g.props. Generating MSBuild file
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\obj\SvcUtilBootstrapper.csproj.nuget.g.targets.
Restore failed in 3,32 sec for
C:\Users\MSefer\AppData\Local\Temp\WCFConnectedService\2017_Nov_13_19_03_33\svcutil_bootstrap\SvcUtilBootstrapper.csproj.
An error occurred while bootstrapping svcutil. This usually happens
when processing references. You might be able to work around this
problem by not providing reference parameters, and manually removing
any types redefined in the generated proxy code. Error:An unknown
error occurred while invoking the service metadata component. Failed
to generate service reference.
I change package source(tools->nuget package manager->manage nuget package
...) with nuget.org instead of visual studio package and it works
via:
http://yazilimsozluk.com/visual-studio-2017-net-core-projesine-wcf-eklemede-restoring-nuget-packages-for-bootstrapper-errorerror-restoring-packages-hatasi

Nuget Package cannot be installed in NET Core v1.1 Project

Trying to build a project with a reference to a package that should be compatible with .net core 1.1 but when nuget is restoring packages (VS.NET 2017 or the command line) I an see an error message
"One or more of the packages are incompatible with netcoreapp1.1"
The package name is
Microsoft.AspNetCore.DataProtection.AzureStorage
It says it is compatible with .NET Standard v1.5
And the error relates to dependencies of the package:
Microsoft.Data.Edm
Microsoft.Data.Services.Client
Microsoft.Data.OData
Microsoft.Data.Spatial
The csproj file has a package fallback setting:
<PackageTargetFallback>
$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;
</PackageTargetFallback>
Not sure what the problem is
thanks
Michael

MVC 4 project does not resolve reference to System.Web.Helpers in VS 2015

It works in VS2013, where the reference is found on the system at "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.Helpers.dll". This is not found on my clean Win10 install with VS2015.
Any ideas why?
It's because MVC 4 is not installed with VS 2015. You can install it from here.
Note that, strangely, you cannot install the nuget package microsoft-web-helpers, which contains this assembly. It will have a version conflict for one of it's dependencies with MVC 4.
Install-package : Unable to find a version of 'Microsoft.AspNet.WebPages' that is compatible with 'microsoft-web-helpers 2.1.20710.2 constraint: Microsoft.AspNet.WebPages (≥ 2.0.0 && < 2.1.0)', 'Microsoft.AspNet.Mvc 5.2.2 constraint: Microsoft.AspNet.WebPages (≥ 3.2.2 && < 3.3.0)'.
At line:1 char:1

entity framework 5 install on win8 MSVC2012 RTM

I have recently installed the Latest Win8 OS (RTM) and installed MSVC 2012 RTM as well (I also have MSVC 2010 installed as I am porting from Win7 Phone to Win 8 Tablet and need to refer to the old code (not sure if this may affect outcome)). I need to install Entity Framework in MSVC 2012 and when I look at the NuGet Package Manager it tells me version 5.0.0. is available. However it never installs correctly, it says it has installed successfully then, says it can't and uninstalls it. I have tried using the NuGet Package Manager and the PM console, the results from the PM console are below :
PM> Install-Package EntityFramework
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 5.0.0'.
Successfully uninstalled 'EntityFramework 5.0.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'EntityFramework 5.0.0'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5', but
the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package EntityFramework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
When I look at the packages folder during the install it all seems present and then it is deleted. I have admin rights set on my user Account.
What is going wrong? pls help.
Brenda
You are adding EntityFramework package to Windows 8 Application or class library project (= to Metro application). That is not supported. You must use full .NET Framework 4.5 (= desktop application, web application, etc.) to use Entity Framework.
I had this problem. This is what I did:
From the package manager console:
PM> Uninstall-Package EntityFramework -Force
This threw an error. I then went to the "packages" folder under the solution folder and removed the Entity Framework subfolder. I then ran
PM> Install-Package EntityFramework
And then right-clicked my project where I wanted to install EF and installed it from the NuGet dialog.