Entity Framework won't install properly, Enable-Migrations command fails - entity-framework-6

I am trying to follow this tutorial: https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/
I am using Visual Studio 2017 and Net 4.6.1.
Right off the bat, things seem to go wrong. When I use the command Install-Package EntityFramework in the Package Manager Console, I get this warning:
Missing function body in function declaration.
At C:\Users\TC\Documents\Temp\Entity Framework Example\MigrationsDemo\packages\EntityFramework.6.4.0\tools\EntityFramework6.PS2.psm1:241 char:5
+ <<<< WarnIfOtherEFs 'Enable-Migrations'
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingFunctionBody
Import-Module : The module to process 'EntityFramework6.PS2.psm1', listed in field 'ModuleToProcess' of module manifest 'C:\Users\TC\Documents\Temp\Entity Framework Example\MigrationsDemo\packages\EntityFramework.6.4.0\tools\EntityFramework6.PS2.psd1' was not processed because no valid module was found in any module directory.
At C:\Users\TC\Documents\Temp\Entity Framework Example\MigrationsDemo\packages\EntityFramework.6.4.0\tools\init.ps1:11 char:18
+ Import-Module <<<< (Join-Path $PSScriptRoot 'EntityFramework6.PS2.psd1')
+ CategoryInfo : ResourceUnavailable: (EntityFramework6.PS2:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
If I continue with the tutorial, everything works perfectly until I get to the step where I run Enable-Migrations in the Package Manager Console. That command fails with this error:
The term 'Enable-Migrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ Enable-Migrations <<<<
+ CategoryInfo : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Why am I getting this error, and what can I do to fix it?
Edit
I thought it might help to upgrade my development environment, so I switched to Visual Studio 2019 and targeted Net 4.7.2. I continue to get the exact same errors.
Can someone please tell me whether you can recreate the behavior I describe? It would be a big help to my debugging process to know whether the problem is on my end, or whether there is something wrong with EntityFramework which is causing the same errors for everyone.
Edit
Still trying to find a fix, I've been trying older versions of Entity Framework. The current version is 6.4.0 – doesn't work. The previous version is 6.3.0 – doesn't work. The version before that is 6.2.0 – works without a hitch. So, I'm going to start developing my project using 6.2.0. If anyone knows why the newer versions fail, please tell me. I'd like to be on the most recent version.

I figured out what was wrong. Entity Framework 6.4.0 requires PowerShell 3 or higher. I was getting those errors because I had PowerShell 2. I fixed all my problems by upgrading PowerShell.

Related

Error at building project in MonoDevelop

I tried to build my existing MVC application with MonoDevelop. The error I get is this:
Error: Error building target IncludeRoslynCompilerFilesToItemGroup: Item has already been added. Key in dictionary: 'Link' Key being added: 'Link'
The project has been developed on another machine running Windows and using VS2017 and the error I get when running the project on my machine running Linux.
The command grep IncludeRoslynCompilerFilesToItemGroup * -R in my terminal returns packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props: <Target Name="IncludeRoslynCompilerFilesToItemGroup" AfterTargets="ResolveAssemblyReferences" >
But I'm stuck at this point. Do you have any recommendations about what should I do next to solve this error?
based on this answer one possible solution is to remove these references from your project:
Microsoft.Net.Compilers
Microsoft.CodeDom.Providers.DotNetCompierPlatform

installed bower how to use it

I have installed bower through Solutions Package Manager in VS 2017. I obviously want to use it.
I'm confused because that only created cmd files (node, bower & git) in a new .bin folder. No components folder or json or anything else.
Shall I run bower init somewhere (where? a command line). When I'm trying to do it it asks me for a 'name' . Name of what I should give? Will that be a bower json file or components folder name or something else? What other questions will it ask?
All bower manuals I find say to do the install and then do bower install of a package (from a command line I guess?)
And where do I perform 'bower search'?
https://bower.io/
On the other hand when I tried to run this command (before I installed Bower package from solutions manager) in nuget console:
npm install -g bower
I got an error:
npm : npm WARN deprecated bower#1.8.0: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD
projects. Currently there's no migration path but we hope you'll help us figure out one.
At line:1 char:1
+ npm install -g bower
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (npm WARN deprec...figure out one.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

FDT Cannot compile for iOS "compile-abc: Permission denied"

I'm getting the following error when compiling for iOS in FDT (OSX):
Packaging failed!
Packaging error message:
Compilation failed while executing : compile-abc
Packaging output:
/var/folders/96/gkk__zq13zg7z70dlp_lnw580000gq/T/cmd973180567546602806.tmp: line 2: /Users/ben/Documents/work/resources/flash/flex_sdk_4.6.0/lib/aot/bin/compile-abc/compile-abc: Permission denied
/var/folders/96/gkk__zq13zg7z70dlp_lnw580000gq/T/cmd6338527548194546742.tmp: line 2: /Users/ben/Documents/work/resources/flash/flex_sdk_4.6.0/lib/aot/bin/compile-abc/compile-abc-64: Permission denied
I'm using the AIR 18 Beta, I've tried with 17 with the same issue.
I've had to use Java 1.7 rather than 1.6 as this is a requirement for the latest version of FDT.
I've created a clean project with no additional libraries but I'm still seeing the issue.
I can compile for desktop and Android without the issue.
Any help would be appreciated.
Ben
check out these links:
http://www.flashdeveloper.co/post/111191611037/compilation-failed-while-executing-compile-abc
http://forum.starling-framework.org/topic/cannot-build-with-air-16
Also please keep in mind, that you use an AIR BETA version.
Maybe you could also check, if your SDK user access rights are set.

how to solve this error on windows??? droidgap unrecognized

i download phonegap but it's bin folder just contain droidgap with unknown type.
when i use this command in command prompt with ruby droidgap wiz the result is :
droidgap is not recognized :(
i also install ant and sdk manager. and add their path to system path.i decide to use eclipse to build my android app(i write my app with js,css, html5). but when i make my app with eclipse browse button does not work & when i build it with phonegap browse button work. if you know solution please suggest it.
thanks in advane
That is actually a ruby executable file. To run droidgap you must have ruby installed.
refer here for installation of ruby https://www.ruby-lang.org/en/downloads/
and make sure that you set the path to ruby2.0.3/bin
here is the missing set up guide by phil http://dev.tonic1394.com/2010/06/phonegap-the-missing-androidwindows-setup-guide/

Pub does not download dependencies on Windows 7 after the update to lib v2 (SDK 0.3.1_r17328)

After the update to the version 0.3.1_r17328 of Dart SDK and Dart Editor I have some trouble to import some library particulary Args library. I have the same problem both directly importing Args or importing Web_ui where Args is one of the dependencies.
Here is my pubspec.yaml:
name: notes
description: A sample application
dependencies:
web_ui: 0.3.0+1
or:
name: notes
description: A sample application
dependencies:
args: 0.3.1+1
Here is the error generate from build.dart
Unable to open file: C:/Users/Fabio/Dropbox/progetti/note/packages/args/args.dart'package:web_ui/component_build.dart': Error: line 25 pos 1: library handler failed
import 'package:args/args.dart';
'file:///C:/Users/Fabio/Dropbox/progetti/note/build.dart': Error: line 1 pos 1: library handler failed
import 'package:web_ui/component_build.dart';
I solved the problem. It seems that the Cache folder (Pub) has been corrupted.
I have deleted the folder Cache: C:\Users\<UserName>\AppData\Roaming\Pub
Then i run pub install from command line and it works.
Unfortunately, I was getting the same error with my windows XP machine.
In the end, I logged into my windows 7 machine and was able to
download the packages, zipped them up and pasted the libraries into my
windows XP dart editor. Success!
I had no reason to believe I had the exact proxy issue #shindokaku had as I am using my home computer.
I tried all the suggestions on deleting the .cache files, pub.lock files and the packages folder and retrying. I uninstalled dart editor and tried again. I also tried using the git resources to download web-ui and running commands through the command line to no avail
Including suggestions in this similar questions:
cannot-find-referenced-source-packages
is-there-a-workaround-for-pub-dependency-resolution-through-proxies
This problem has been haunting me over and over for a few weeks. I am not using Windows, so this answer is not intended to help the original poster who is using Windows 7.
If you are using Linux here are the steps I use to repair corrupted pub cache.
Go to the top level directory of your app. You should see at least pubspec.lock, pubspec.yaml, a folder named packages, and a folder named web.
Delete your pubspec.lock, and packages folder.
[Make sure you aren't storing your own libraries in the packages folder]
cd ~/dart/myApp/
rm -r packages
rm pubspec.lock
Now once you have removed these files:
pub cache repair
Note 1: if your dart-sdk is not in your systems $PATH, than you will want to use the absolute path to the sdk when using the above command. Comment if you need that explained.
Note 2: This is working solution with Dart 1.5.3. I have not tested this on earlier versions.
Try deleting your pubspec.lock file and packages directory in the root folder of the project. Then run pub install again, when things get wacky thats what I do.
You should try to run pub update. I have sometimes found that this doesn't work as expected from the editor, but generally works quite smoothly when called from the command line.

Resources