I have an Ionic3 project create over a year ago. How do I get to use the SCSS linter?
This is my package.json
{
"name": "xxx",
"author": "xxx",
"homepage": "xxx",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint --bailOnLintError true",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"test": "ng test"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"dependencies": {
"#angular/animations": "5.1.0",
"#angular/common": "5.1.0",
"#angular/compiler": "5.1.0",
"#angular/compiler-cli": "5.1.0",
"#angular/core": "5.1.0",
"#angular/forms": "5.1.0",
"#angular/http": "5.1.0",
"#angular/platform-browser": "5.1.0",
"#angular/platform-browser-dynamic": "5.1.0",
"#angular/platform-server": "5.1.0",
"#firebase/webchannel-wrapper": "^0.2.5",
"#ionic-native/badge": "4.3.3",
"#ionic-native/camera": "4.3.3",
"#ionic-native/core": "4.3.3",
"#ionic-native/deeplinks": "4.3.3",
"#ionic-native/geolocation": "4.3.3",
"#ionic-native/google-analytics": "4.3.3",
"#ionic-native/launch-navigator": "4.3.3",
"#ionic-native/network": "4.3.3",
"#ionic-native/push": "4.3.3",
"#ionic-native/splash-screen": "4.3.3",
"#ionic-native/status-bar": "4.3.3",
"#types/googlemaps": "3.26.20",
"angular2-moment": "^1.7.0",
"angularfire2": "^5.0.0-rc.5-next",
"cordova-ios": "^4.5.4",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-badge": "^0.8.5",
"cordova-plugin-camera": "^3.0.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-dialogs": "^1.3.4",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-google-analytics": "^1.8.3",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.3.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-sqlite-storage": "^2.1.2",
"firebase": "^4.8.0",
"ionic-angular": "^3.9.2",
"ionic-plugin-deeplinks": "^1.0.15",
"ionicons": "3.0.0",
"promise-polyfill": "6.0.2",
"rxjs": "^5.5.5",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.1.0",
"zone.js": "^0.8.18"
},
"devDependencies": {
"#angular/cli": "1.6.8",
"#ionic/app-scripts": "^3.1.8",
"#types/jasmine": "^2.8.2",
"#types/node": "^7.0.48",
"codecov": "^2.3.1",
"husky": "^0.15.0-rc.7",
"ionic": "3.19.1",
"jasmine-core": "^2.8.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.1",
"karma-mocha-reporter": "^2.2.5",
"karma-remap-istanbul": "^0.6.0",
"ts-node": "^3.3.0",
"tslint": "^5.9.1",
"tslint-eslint-rules": "^4.0.0",
"typescript": "2.4.2"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"cordova-plugin-network-information",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"ios",
{
"platform": "ios",
"version": "",
"locator": "ios"
}
],
"description": "xxx",
"cordova": {
"platforms": [
"ios"
],
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-network-information": {},
"cordova-plugin-whitelist": {},
"cordova-sqlite-storage": {},
"ionic-plugin-deeplinks": {
"URL_SCHEME": "xxx",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "xxx",
"ANDROID_PATH_PREFIX": "/",
"ANDROID_2_PATH_PREFIX": "/",
"ANDROID_3_PATH_PREFIX": "/",
"ANDROID_4_PATH_PREFIX": "/",
"ANDROID_5_PATH_PREFIX": "/",
"DEEPLINK_2_SCHEME": " ",
"DEEPLINK_2_HOST": " ",
"DEEPLINK_3_SCHEME": " ",
"DEEPLINK_3_HOST": " ",
"DEEPLINK_4_SCHEME": " ",
"DEEPLINK_4_HOST": " ",
"DEEPLINK_5_SCHEME": " ",
"DEEPLINK_5_HOST": " "
},
"cordova-plugin-google-analytics": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"LOCATION_USAGE_DESCRIPTION": "This app requires access to your location for navigation purposes"
},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-camera": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-badge": {},
"cordova-plugin-statusbar": {}
}
}
}
You should install with :npm i tslint-ionic-rules --save-dev
and than in your tslint.json file add:
{
"extends": "tslint-ionic-rules"
}
Related
I'm using the Ionic AppFlow Live Update deployment feature without problems but the build is made using the development environment instead of production. I have a similar app using Live Update that builds correctly in production environment and I can't find any differences in the configuration of both apps.
I have two environment files:
environment.prod.ts
environment.ts
and the app is using the environment.ts configuration, which is for development.
I can install correctly the app in production mode in a device through USB using:
$ ionic cap copy --configuration=production
$ ionic cap open android
How can I force AppFlow to use the production environment for the build?
package.json:
{
"name": "app-name",
"version": "0.3.2",
"author": "John Doe",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
...
}
ionic.config.json
{
"name": "app-name",
"integrations": {
"capacitor": {}
},
"type": "angular"
}
angular.json
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"baseHref": "/",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
},
"src/manifest.webmanifest",
"src/manifest.webmanifest",
"src/manifest.webmanifest"
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": [],
"aot": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true,
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"ci": {
"progress": false
}
}
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
},
"ci": {
"progress": false
}
}
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
},
"src/manifest.webmanifest",
"src/manifest.webmanifest",
"src/manifest.webmanifest"
]
},
"configurations": {
"ci": {
"progress": false,
"watch": false
}
}
},
"lint": {
"builder": "#angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {
"builder": "#angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
}
}
}
},
"cli": {
"schematicCollections": [
"#ionic/angular-toolkit"
]
},
"schematics": {
"#ionic/angular-toolkit:component": {
"styleext": "scss"
},
"#ionic/angular-toolkit:page": {
"styleext": "scss"
}
}
}
I realized that because I'm using the free AppFlow version there is no Environments option. So I changed the build script to:
"build": "ng build --configuration=production",
and it worked.
In the Basic Plan and above, you can create environments and environments variables, as described in the official documentation.
I have an existing Ionic project which does not include the node_modules/ folder, I want to install Node and NPM but I am not sure which version(s) I have to install.
This is my package.json, the versions of the packages are shown:
{
"name": "BXXXXX",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "^7.2.2",
"#angular/core": "^7.2.2",
"#angular/forms": "^7.2.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "^7.2.2",
"#angular/platform-browser-dynamic": "^7.2.2",
"#angular/router": "^7.2.2",
"#ionic-native/call-number": "^5.34.0",
"#ionic-native/camera": "^5.3.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/http": "^5.8.0",
"#ionic-native/keyboard": "^5.9.0",
"#ionic-native/photo-viewer": "^5.7.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.1.0",
"#ionic/storage": "^2.2.0",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^4.0.0",
"angular2-moment": "^1.9.0",
"call-number": "1.0.1",
"com-sarriaroman-photoviewer": "1.2.2",
"cordova-android": "7.0.0",
"cordova-browser": "5.0.4",
"cordova-ios": "^5.0.1",
"cordova-plugin-advanced-http": "2.1.1",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "6.0.1",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^4.1.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"core-js": "^2.5.4",
"ionic-swipe-all": "^2.0.0",
"rxjs": "^6.5.1",
"zone.js": "~0.8.29"
},
"devDependencies": {
"#angular-devkit/architect": "0.1201.1",
"#angular-devkit/build-angular": "~0.13.0",
"#angular-devkit/core": "~7.2.3",
"#angular-devkit/schematics": "~7.2.3",
"#angular/cli": "~7.3.1",
"#angular/compiler": "~7.2.2",
"#angular/compiler-cli": "~7.2.2",
"#angular/language-service": "~7.2.2",
"#ionic/angular-toolkit": "~1.4.0",
"#ionic/lab": "1.0.24",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~10.14.2",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.4",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.13.1",
"protractor": "~5.4.0",
"ts-node": "~8.0.0",
"tslint": "~5.12.0",
"typescript": "~3.1.6"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-camera": {},
"com-sarriaroman-photoviewer": {},
"cordova-plugin-advanced-http": {
"OKHTTP_VERSION": "3.10.0"
},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {}
},
"platforms": [
"android",
"browser",
"ios"
]
}
}
I did initially add this code to my index.html:
<script src="https://unpkg.com/ionicons#5.0.0/dist/ionicons.js"></script>
To use the latest version of the ionicons but now when I remove that line from index.html, none of my ionicons are no longer appearing. I am running ionic cordova run android to test it on a physical device.
ionic info
Ionic:
Ionic CLI: 5.4.16 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : #ionic/angular 4.11.7 #angular-devkit/build-angular : 0.900.2 #angular-devkit/schematics : 9.0.2 #angular/cli : 9.0.2 #ionic/angular-toolkit : 2.0.0
Capacitor:
Capacitor CLI: 1.2.1 #capacitor/core : 1.2.1
Cordova:
Cordova CLI: 9.0.0 (cordova-lib#9.0.1) Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard
2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 12 other plugins)
Utility:
cordova-res: 0.4.0 native-run: 0.2.6
angular.json
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/#ionic/angular/dist/ionic/svg",
"output": "./svg"
}
],
"styles": [
{
"input": "src/theme/variables.scss"
},
{
"input": "src/global.scss"
}
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"ci": {
"progress": false
}
}
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
},
"ci": {
"progress": false
}
}
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
]
},
"configurations": {
"ci": {
"progress": false,
"watch": false
}
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "#angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"ionic-cordova-build": {
"builder": "#ionic/angular-toolkit:cordova-build",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "#ionic/angular-toolkit:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
}
}
}
},
"cli": {
"defaultCollection": "#ionic/angular-toolkit",
"analytics": false
},
"schematics": {
"#ionic/angular-toolkit:component": {
"styleext": "scss"
},
"#ionic/angular-toolkit:page": {
"styleext": "scss"
}
}
}
package.json
{
"name": "project",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "~9.0.1",
"#angular/compiler": "~9.0.1",
"#angular/core": "~9.0.1",
"#angular/forms": "~9.0.1",
"#angular/platform-browser": "~9.0.1",
"#angular/platform-browser-dynamic": "~9.0.1",
"#angular/router": "~9.0.1",
"#capacitor/android": "^1.4.0",
"#capacitor/core": "1.2.1",
"#ionic-native/android-permissions": "^5.19.1",
"#ionic-native/barcode-scanner": "^5.19.1",
"#ionic-native/camera": "^5.19.1",
"#ionic-native/core": "^5.19.1",
"#ionic-native/file": "^5.19.1",
"#ionic-native/file-opener": "^5.19.1",
"#ionic-native/file-transfer": "^5.19.1",
"#ionic-native/http": "^5.19.1",
"#ionic-native/in-app-browser": "^5.19.1",
"#ionic-native/ionic-webview": "^5.19.1",
"#ionic-native/qr-scanner": "^5.19.1",
"#ionic-native/splash-screen": "^5.19.1",
"#ionic-native/status-bar": "^5.19.1",
"#ionic/angular": "^4.11.7",
"#ionic/cli": "^6.1.0",
"#ionic/storage": "^2.2.0",
"#swimlane/ngx-datatable": "^16.0.3",
"cordova-android": "^8.1.0",
"cordova-plugin-advanced-http": "^2.3.1",
"cordova-plugin-android-permissions": "^1.0.2",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^2.2.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-sqlite-storage": "^3.4.1",
"core-js": "^2.6.11",
"file-saver": "^2.0.2",
"ionicons": "^5.0.0",
"ngx-qrcode2": "0.0.9",
"phonegap-plugin-barcodescanner": "^8.1.0",
"rxjs": "^6.5.4",
"tslib": "^1.9.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "^0.900.2",
"#angular-devkit/core": "~9.0.2",
"#angular-devkit/schematics": "~9.0.2",
"#angular/cli": "~9.0.2",
"#angular/compiler-cli": "~9.0.1",
"#angular/language-service": "~9.0.1",
"#capacitor/cli": "1.2.1",
"#ionic/angular-toolkit": "~2.0.0",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "^2.0.8",
"#types/node": "~8.9.4",
"codelyzer": "^5.2.1",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.1",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.7.5"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-sqlite-storage": {},
"cordova-plugin-advanced-http": {
"OKHTTP_VERSION": "3.10.0"
},
"cordova-plugin-file-transfer": {},
"cordova-plugin-android-permissions": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-file-opener2": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"android"
]
}
}
METHOD 1
Try to run:
cordova clean
and retry. If not work follow method two
METHOD 2
try to run:
ionic cordova platform rm android
remove your node_modules folder and run
npm install
and
ionic cordova platform add android
I have a database I am trying to scaffold into my angular 2 .net core application. I upgraded to .net core 1.1 followed most steps but I am getting the error the specified deps.json does not exist. This is my project.json
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore": "1.1.0",
"Microsoft.AspNetCore.Mvc.Core": "1.1.1",
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"appsettings.json",
"ClientApp/dist",
"node_modules",
"Views",
"web.config",
"wwwroot"
]
},
"scripts": {
"prepublish": [
"npm install",
"node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod",
"node node_modules/webpack/bin/webpack.js --env.prod"
],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"tooling": {
"defaultNamespace": "HannaOilAndGas2"
}
}
this is how I am trying to scaffold my database
Scaffold-DbContext "Server=myserver,1433;Initial Catalog=database;Persist Security Info=False;User ID=myid;Password=mypassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Data
this connection string works because I have built regular models and accessed them with this connection string. Any help would be greatly appreciated.
on this line
"
frameworks": {
"netcoreapp1.1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
I needed to change to
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
I am using the new "dotnet" CLI to do my initial EF 7.0 migration. My connect string is as follows:
"Data Source=RICHSOLUTIONS\\SSDEV2014;Initial Catalog=TheWorldDB;Integrated Security=True"
However when i go to the Developer Command prompt and enter
dotnet ef migrations add MyFirstMigration
I get the following error:
Project TheWorld (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName).....
the project.json is
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SqlServer": "7.0.0-beta8",
"Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview1-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview1-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview1-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview1-final",
"Microsoft.Framework.Runtime.Abstractions": "1.0.0-beta5",
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview1-final"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"userSecretsId": "aspnet-TheWorld-20160624024822"
}