Install-Package EntityFramework.Triggers not working - triggers

I am working on a asp.net core project. Here I want to use a trigger. I find a solution and that is Install-Package EntityFramework.Triggers. But in my solution I unable to install Install-Package EntityFramework.Triggers. It shows error "Package restore failed. Rolling back package changes for 'ProjectName'".
Is there any easy way to apply trigger in my asp.net core project.
Thanks in advance.

Related

How to fix 'Failed to Update dependency information of the project. Please restore the project and try again'

I'm writing a new web API using .net core 2.2 and I connected an existing database using entity framework. but I keep getting an error saying above when I try to add a controller to the existing model using Scaffold new item.
here are the commands I used
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design
Scaffold-DbContext to reverse engineer and create the EF model based on my existing database.
but keeps getting below error
"There was an error running the selected code generator: ' Failed to update dependency information for the project. Please restore the project and try again.'
I tried everything I could think of and I even gets the same error when I tries to add an empty controller also
I met this issue and found nothing wrong in my project.
After deleting the bin and obj folder, this issue is gone.
i had the same error
then i uninstalled all packages and reinstall them again throught nuget
i don't no why but it worked for me
It was due to a mismatch between .netCore version and EntityFrameworkCore version.
Edit
I uninstalled the EFCore and installed a parallel versiion for .net core
Ex
.netCore 2.0.9
EFCore 2.2.4

NuGet Installation of EntityFramework

I have been doing some testing between VS2015 and VS2017. I created a .NetFrameworkApp and a .NetCoreApp website in both systems. I then installed a couple of packages in all four websites; in particular EntitytFramework. It installed in both VS2015 websites and the VS2017 .NetFrameworkApp website without problem but it wouldn't install in the VS2017 .NETCoreApp website. I got the following error messages.
net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package restore failed. Rolling back package changes for 'RLSBCWebSite_NC'.
Time Elapsed: 00:00:01.4470850
Error Package restore failed. Rolling back package changes for 'RLSBCWebSite_NC'. 0
Anyone any idea why that should be. I am assuming it should install otherwise how would you use CodeFirst etc.
The "EntityFramework" package is not supported with .NET Core App, use the:
Microsoft.EntityFrameworkCore.SqlServer
package instead

VS2012 and Entity Framework 6.1.3 compatibility

I am using VS2012 and trying to run a code I have received from a colleague (who happens to use VS2013). He is using EF (v 6.1.3) Code-First New Database approach.
Now I am trying to enable the migrations to create the database, but Package Manager Console is unable to identify Enable-Migrations code.
Below is the error I receive (please click the image to enlarge)
I have installed EF Tools for VS2012, but that does't resolve the issue. Even Microsoft tells that it can only resolve EF Code-First Existing Database problems.
I don't know if I have to rollback Microsoft.NETCore.Platforms v1.1.0 to a previous version.
Any help on this is appreciated.
Edit
Error tells that I need a newer Nuget version, but VS2012 doesn't support Nuget v2.12

xunit nuget package restore failed

I've come to a problem while trying asp.net vNext beta8. I'm running a working project but I wanted to add a unit test project next to it. I've found that you should add the xunit and xunit.runner.dnx nuget packages in the project.json. while typing, the intellisense continuous me so I see that the package must be downloaded from nuget. after saving the project.json i get the error in my output, which says: An error occurred while sending the request.
Does anyone else get this problem or does anyone know the solution?
Thanks in advance :)
My problem appeared to be a corporate proxy which didn't like visual studio and the nuget package manager. when working on the guest network I was able to restore all the packages.

azure mobile service .net backend not working after nuget packages update

After updating the nu-get packages for a previously working Azure Mobile Service (.Net back-end), I now get the following error when accessing Table Controllers:
An error has occurred.","exceptionMessage":"Object reference not set to an instance of an
object.",
"exceptionType":"System.NullReferenceException",
"stackTrace":"at Microsoft.WindowsAzure.Mobile.Service.Serialization.
SelectExpandWrapperConverter.ODataReflectedTypes..ctor()
at Microsoft.WindowsAzure.Mobile.Service.Serialization ...
Custom Controllers appear to be unaffected.
I've probably missed something obvious, but I can't see it
Any help would be appreciated
Many Thanks
K.
From Henrik F. Nielsen's answer in the MSDN forums:
There are known incompatibilities with the latest version of ASP.NET Web API which was released the same day as our last update. We are working on an update but in the mean time please don't update all your NuGets but only the WindowsAzure.MobileServices.* packages -- they will then include the right dependencies the need.
This is an integration issue with the .NET backend binaries, and it should be resolved soon.
Expanding on #carlosfigueira's answer, it seems that the WepApi 5.2.0 version is not compatible with Azure Mobile Services yet.
I am one of the unfortunate ones who decided to let nuget go to town and update all the packages in the project so here is what I did to deal with this.
Uninstall every nuget package from your mobile service project. Then add them back. Start by using only the Microsoft Azure Mobile Services.NET Backend.* packages - This will pull the currently compatible WebApi 5.1.2 instead of 5.2.0. and other dependent assemblies.
In addition, I was getting a lot of weird redirect binding errors which I believe the tooling added incorrectly - so I commented out all the dependentAssembly tags in the assemblyBindings and then added them back as the mobile service complained. All I had to add back for redirects were Newtonsoft.Json and Microsoft.Owin. YMMV.
I think this may also have something to do with the fact that there are strange interactions between VS and source control plugins since nuget packages sometimes fail because they can't obtain write permissions for packages.config and web.config files.
I am also using a PCL in my service which requires adding the Microsoft.Bcl libraries - perhaps irrelevant but it is what lead me to discovering the underlying error.
Under Tools -> Options -> Projects and Solutions -> Build and Run, set the MSBuild project build output verbosity to Detailed or above to get some insight into what is happening in the process.
[Update 12/24/2014]
I updated something I shouldn't have and everything broke again.
Uninstall all nuget packages. Delete all dependentAssembly elements from the Web.Config file. Save and restart Visual Studio.
Start adding packages back using the following from the Package Manager Console. In my case:
Install-Package WindowsAzure.MobileServices.Backend -Version 1.0.405
Install-Package WindowsAzure.MobileServices.Backend.Tables -Version 1.0.405
Install-Package WindowsAzure.MobileServices.Backend.Entity -Version 1.0.405
Install-Package WindowsAzure.MobileServices.Backend.SignalR -Version 1.0.405
Install-Package WindowsAzure.MobileServices.Backend.Storage -Version 1.0.405
Never touch it again...?