I am trying to upgrade version of Microsoft.EntityFrameworkCore.SqlServer to 2.1.1. After upgrading to 2.1.1 I am getting error shown in screenshot on following code of piece marked in bold
var queryCompiler = (IQueryCompiler)_queryCompilerField.GetValue(queryable.Provider);
var queryModelGenerator = (**IQueryModelGenerator**)_queryModelGeneratorField.GetValue(queryCompiler);
var queryModel = queryModelGenerator.ParseQuery(queryable.Expression);
var database = _databaseField.GetValue(queryCompiler);
var queryCompilationContextFactory = ((DatabaseDependencies)_dependenciesProperty.GetValue(database)).QueryCompilationContextFactory;
var queryCompilationContext = queryCompilationContextFactory.Create(false);
var modelVisitor = (**RelationalQueryModelVisitor**)queryCompilationContext.**CreateQueryModelVisitor**();
modelVisitor.CreateQueryExecutor<TEntity>(queryModel);
Error while upgrading Microsoft.EntityFrameworkCore.SqlServer version:
Usually, the type or namespace could not be found error occurs if you are referencing a namespace that is not found by the compiler. It means that when upgrading to later version, the referenced assembly is not installed or if the namespace or type changed in a newer version.
Need to check & resolve:-
Uninstall the package and reinstall it. Rebuilding the solution will sometimes work because it clears all the cache and rebuilds it.
Reload your project in solution explorer (VScode) and modify the .csproj if any package reference exists.
To avoid these errors, change your package reference to Microsoft.AspNetCore.All. All Entity Framework references will be included.
If the namespace has changed in the version which you are trying to upgrade, you must update your code requirements accordingly.
Check whether you are correctly referencing the installed version in code.
Note: Any other packages that rely on Microsoft.EntityFrameworkCore.SqlServer must be compatible with Microsoft.EntityFrameworkCore.SqlServer version.
Check dependencies here.
Refer MSDoc.
Related
I installed a project from work on my personal computer and only on my machine I get this runtime error. I personally think it has to do with the way the code is compiled.
My question is why the error appears on my machine only?
Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported.
https://errors.angularjs.org/1.6.7/ng/cpws
First thing I checked to see if the node and npm versions are the same and they are:
node: v8.11.3
npm: 5.6.0
OS: Windows 10
The piece of code that generates this error is using $scope.$watch(object, callback, true). After looking on the angular documentation I deleted the third parameter which seemed to be the trouble maker. After that, I encountered other problems so I asked myself why on my machine (which from an environment perspective is the same) the error appears and I stopped modifying the code and start looking on the building part.
I don't know if this will help you but the page that generates the error contains a form build using angular-formly.
Also, we are using laravel mix to compile the code.
UPDATE
I just updated the node and npm version. At first, I had some issues with the node-sass package but I solved it.
I still have the errors. :(
node: v11.10.0
npm: 6.8.0
Try to recheck if the correct version of angularjs is loaded for you. Many boilerplates declare the angular dependency using something like:
...
"angular": "^1.6.7",
...
When npm sees this it will load the latest MINOR version if the library is not in node_modules directory. If it is in the node_modules directory and it is greater or equal to 1.6 it will leave it as is. Having a package-lock file might save you from this issue if you actually commit it in the version control system that you use.
This is problematic because loading the 1.7 version might bring in backward incompatible changes (angularjs does not respect semver).
I am trying to develop an azure function that triggers off an insert/update in the collection. From the azure webjobs sdk documentation, my best bet is a CosmosDBTrigger function. However, I am getting a compilation error when I create a CosmosDBTrigger function using the Visual Studio "azure functions" extension. It looks like the vsix for CosmosDBTrigger does not automatically include the nuget package references for the CosmosDBTrigger class.
Has anyone used Visual Studio 2017 to create an azure function triggered from a ChangeFeed item?
Update: When I tried to inlude Microsoft.Azure.Webjobs.Extensions, I get the following error.
NU1608: Detected package version outside of dependency constraint: Microsoft.NET.Sdk.Functions 1.0.11 requires Microsoft.Azure.WebJobs.Extensions (= 2.1.0) but version Microsoft.Azure.WebJobs.Extensions 3.0.0-beta5 was resolved.
NU1107: Version conflict detected for Microsoft.Azure.WebJobs. Reference the package directly from the project to resolve this issue.
Accelerator.Feed Microsoft.Azure.WebJobs.Extensions 3.0.0-beta5 -> Microsoft.Azure.WebJobs (>= 3.0.0-beta5)
Accelerator.Feed -> Microsoft.NET.Sdk.Functions 1.0.11 -> Microsoft.Azure.WebJobs (= 2.1.0).
Package restore failed.
According to Azure Cosmos DB bindings for Azure Functions, you'll need NuGet package Microsoft.Azure.WebJobs.Extensions.CosmosDB
The Cosmos DB bindings for Functions version 1.x are provided in the Microsoft.Azure.WebJobs.Extensions.DocumentDB NuGet package. For Functions 2.x, the package is Microsoft.Azure.WebJobs.Extensions.CosmosDB.
I am working with asp.net core- Visual studio 2015.While accessing my sql database the following error occurs. "Please add the Entity.framework.SqlServerCompact NuGet package to the project". Please let me know how to resolve this issue. Thanks in advance.
Well with ASP.net Core everything is optional and as Nuget packages which means you have to bring them in your project if you want to use them.
If you want to add any Nuget package to your project you just need to open your project json file and add this line into dependencies:
Microsoft.EntityFrameworkCore.SqlServer
Or run npm install in your project directory:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Then locate your tools section in your project json and add this into it:
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
If you had any problem with the version see if using this version is helping:
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview2-final"
Reason is this is a known issue you can find here:
https://github.com/dotnet/cli/issues/3742
Check the version in case has changed. For a more detailed instructions look here:
https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db
I'm trying to add migration package to CakePHP 3.3 using the command
composer require cakephp/migration:~1.0
but I'm receiving the following result:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cakephp/migration could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
Any suggestions to solve this?
As #ndm said its "migrations", also it should be allready installed by default if you created your app with composer or such. To activate it you just need to load it in the bootstrap.php as specified here Plugin::load('Migrations');
I'm trying to get my first angularjs project to work within Visual Studio 2015. Worked fine until I tried to move to Typescript. Installed the DefinitelyTyped projects and get lots of error messages.
Here is how to reproduce it:
Create an empty ASP.NET 4.5.2 application
Nuget AngularJS Core 1.4.4
Nuget AngularJS.TypeScript.DefinitelyTyped 4.1.1 (includes jQuery 0.0.1)
Add an empty TypeScript file
Add
/// <reference path="typings/angularjs/angular.d.ts" />
to that file.
that's when I get 444 errors, starting with
Error TS2411 Property 'find' of type '{ (selector: string):
IAugmentedJQuery; (element: any): IAugmentedJQuery; (obj: JQuery):
IAugment...' is not assignable to string index type 'HTMLElement'.
TypeScript Virtual Projects l:\M\eigene dateien\visual studio
2015\Projects\WebApplication3\WebApplication3\Scripts\typings
\angularjs\angular.d.ts
Any idea what I'm doing wrong or how to work around it?
I checked this package and most of the errors seem to come from the jquery.d.ts file, which just looks old. That file still uses "bool" instead of "boolean", which was a breaking change made long ago.
I fixed it by adding "jQuery.Typescript.DefinitelyTyped" to the project, which upgraded the jQuery.d.ts file to a version that parsed properly. As soon as I did that, all of the compiler errors went away.
This seems like a bug in the nuget package authoring. I'll look into opening an issue on github.
Hope that works for you.
UPDATE: I opened this issue in GitHub https://github.com/borisyankov/DefinitelyTyped/issues/5446
I had the same issue, but the above solution didn't work out for me.
jQuery.Typescript.DefinitelyTyped was already installed as it is required by angularjs.TypeScript.DefinetlyTyped package.
I fixed it by:
uninstall angularjs package.
uninstall angularjs.TypeScript.DefinetlyTyped package.
uninstall jQuery.Typescript.DefinitelyTyped
install jQuery.Typescript.DefinitelyTyped
install angularjs.TypeScript.DefinetlyTyped package.
install angularjs package.
Thanks Michael for supplying the hint.
The issue is caused by NuGet in VS 2015, because it defaults to installing the oldest version of its dependencies which in this case installs ancient jQuery DT package for the AngularJS DT package, as explained here.
I fixed this even simpler by just doing these:
Manage NuGet packages for project
Show only installed packages
Select jquery.TypeScript.DefinitelyTyped
Upgrade
Enjoy!