The dependency MySql.Data >= 7.0.6-ir31 could not be resolved - mysql

I tried to deploy my asp.net core web api to nginx, the web api project reference a class library. The class library installed MySql.Data package from nuget. After copied the whole project to ubuntu and executed "dotnet restore" command, all works well in this step. But when I execute 'dotnet publish' command, I got an error:
Compiling App.DAL.Core for .NETStandard, Version=v1.6 /home/.../project.json: error NU1001: The dependency MySql.Data >= 7.0.6-ir31 could not be resolved
I have check this thread,
MySQL -> .NET Core Dependency error (MySql.Data)
Changed IR to ir, but still not work. Please see my project.json files
DAL.Core Porject.json
{
"version": "1.0.0-*",
"dependencies": {
"MySql.Data": "7.0.6-ir31",
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
Web API Project.json
{
"dependencies": {
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"log4net": "2.0.7",
"Newtonsoft.Json": "9.0.1",
"App.DAL.Core": "1.0.0-*",
"MySql.Data": "7.0.6-ir31",
"Microsoft.AspNetCore.Mvc.WebApiCompatShim": "1.0.0",
"System.Net.Http": "4.1.0",
"System.Text.Encoding": "4.3.0",
"Microsoft.AspNetCore.Mvc.Core": "1.0.0",
"System.Net.Requests": "4.0.11",
"Microsoft.NETCore.App": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"runtimes": {
"ubuntu.14.04-x64": {}
}
}
Anyone can help?

Adding the code below to DAL.Core project's project.json file solves the issue
"runtimes": {
"ubuntu.14.04-x64": {}
}

Related

Angulajs-gauge component is in bower.json but doesn't wire over to index.html

I have installed angularjs-gauge component using bower. You can see it shows up in my bower.json below
{
"name": "triangular",
"version": "0.0.0",
"dependencies": {
"jquery": "^3.2.1",
"angular": "1.5.8",
"angular-animate": "1.5.8",
"angular-cookies": "1.5.8",
"angular-material": "1.1.1",
"angular-messages": "1.5.8",
"angular-sanitize": "1.5.8",
"angular-ui-router": "^0.3.1",
"angular-translate": "~2.10.0",
"angular-translate-loader-partial": "~2.10.0",
"angular-translate-storage-cookie": "~2.10.0",
"angular-translate-storage-local": "~2.10.0",
"angular-local-storage": "~0.2.5",
"angular-digest-hud": "~0.1.13",
"highlightjs": "^9.2.0",
"angular-highlightjs": "^0.6.3",
"angular-dragula": "~1.2.2",
"angular-chart.js": "0.10.2",
"angular-google-chart": "~0.1.0",
"angular-nvd3": "^1.0.8",
"angular-google-maps": "2.3.2",
"angular-permission": "^3.2.1",
"angular-linkify": "~1.2.0",
"angular-material-data-table": "0.10.9",
"angular-ui-calendar": "~1.0.1",
"angular-moment": "~1.0.0-beta.4",
"animatewithsass": "~3.2.2",
"countUp.js": "1.6.1",
"font-awesome": "~4.5.0",
"material-design-iconic-font": "~2.2.0",
"weather-icons": "https://github.com/chk1/weather-icons.git#master",
"textAngular": "~1.5.0",
"ng-file-upload": "~12.0.1",
"angular-fixed-table-header": "^0.2.1",
"angularjs-gauge": "^2.1.0"
},
"devDependencies": {
"angular-mocks": "1.5.8"
},
"overrides": {
"angular-material": {
"main": [
"angular-material.js",
"angular-material.scss"
]
},
"weather-icons": {
"main": [
"./css/weather-icons.css",
"./font/*"
]
},
"angular-dragula": {
"main": [
"dist/angular-dragula.js",
"dist/dragula.min.css"
]
},
"font-awesome": {
"main": [
"./css/font-awesome.css",
"./fonts/*"
]
},
"ng-file-upload": {
"main": [
"ng-file-upload-shim.js",
"ng-file-upload.js"
]
}
},
"resolutions": {
"angular": "1.5.8",
"jquery": "~2.2.1"
},
"main": [
"triangular.js",
"triangular.css",
"triangular.scss"
],
"ignore": [
"README.md"
]
}
for some reason it shows up here but the tag never gets created in the index.html file for angularjs-gauge. the others seem to work fine. If I go into my bower_components folder and then click on the bower.json file for the angularjs-gauge component it shows this.
{
"name": "angularjs-gauge",
"version": "1.2.0",
"description": "A Gauge directive for Angular 1.x apps and dashboards",
"keywords": [
"angular",
"gauge",
"speedometer",
"js",
"dial",
"semi",
"full",
"arc"
],
"main": "src/angularjs-gauge.js",
"authors": ["Ashish Chopra"],
"license": "MIT",
"homepage": "https://github.com/ashish-chopra/angular-gauge",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "~1.5.8"
}
}
I tried putting the main element in a list and tried using override as suggested in this post.
Grunt wiredep not wiring some bower components
But every time I ran my gulp tasks it just inserts all the bower components except angularjs-gauge. How do I get it to add the tag in the index file and not skip over this one?
look at this plugin https://www.npmjs.com/package/gulp-bower, haven't tested it but it seems suit you perfectly

Load composer package from private gitlab

In my composer setup I load packages from 2 repos. One composer repo and a private gitlab repo. When I try to do a composer install on my local windows machine, I get the following error messages:
GitLab: The project you were looking for could not be found. fatal:
Could not read from remote repository. Please make sure you have the
correct access rights and the repository exists. ... The requested
package sv-test/testextension could not be found in any version, there
may be a typo in the package name.
Authentification is done via lokal ssh-key and password, that doesnt seem to be the problem. Whats wrong with my setup?
The composer.json of the project looks like this:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org/"
},
{
"type": "git",
"url": "git#gitlab.xydevbox.de:sv-test/Testproject.git"
}
],
"name": "svdev/master-dev-box",
"description": "",
"type": "project",
"license": "MIT",
"homepage": "https://www.xydevbox.de/",
"authors": [
{
"name": "Sacha Vorbeck",
"email": "sacha.vorbeck#xydevbox.de",
"homepage": "https://www.xydevbox.de/",
"role": "Developer"
}
],
"require": {
"sv-testbox/testextension": "*",
"helhum/typo3-console": "^4.5",
"typo3/cms": "^8.7"
},
"config": {
"sort-packages": true,
"process-timeout": 2000,
"preferred-install": {
"typo3/cms": "source",
"*": "dist"
}
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
}
}
}
The composer.json from the package to be included from the gitlab private repo looks like this:
{
"name": "sv-testbox/testextension",
"type": "typo3-cms-extension",
"description": "",
"homepage": "https://www.xydevbox.de/",
"license": ["GPL-2.0+"],
"keywords": ["TYPO3 CMS"],
"version": "master",
"dist": {
"url": "git#gitlab.xydevbox.de:sv-test/Testproject.git",
"type": "git"
}
}
Maybe the latest composer version 1.5.2 is something for you if you take a look at the release notes
Fixed GitLabDriver looping endlessly in some conditions
Fixed
GitLabDriver support for unauthenticated requests
Fixed GitLab zip
downloads not triggering credentials prompt if unauthenticated
Fixed
path repository support of COMPOSER_ROOT_VERSION, it now applies to
all path repos within the same git repository
Fixed path repository
handling of copies to avoid copying VCS files and others
Fixed
sub-directory call to ignore list and create-project commands as well
as calls to Composer using --working-dir
Fixed invalid warning
appearing when calling remove on an non-stable package
https://github.com/composer/composer/releases
Thank you Georg and NextThursday. With some help on TYPO3 slack I finally got it running. The replace part was missing. I also learned that one should not edit composer.json files manually - always use the command line options to modify it. This example: https://github.com/TYPO3-Console/TYPO3-Console/blob/master/composer.json was also helpful.
project composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org/"
},
{
"type": "vcs",
"url": "https://github.com/svorbeck/masterconfig"
}
],
"name": "svorbeck/demo",
"description": "",
"type": "project",
"license": "MIT",
"homepage": "https://xydevbox.de/",
"authors": [
{
"name": "Sacha Vorbeck",
"email": "sacha.vorbeck#xydevbox.de",
"role": "Developer"
}
],
"require": {
"svorbeck/masterconfig": "dev-master",
"typo3/cms": "^8.7"
},
"config": {
"sort-packages": true,
"process-timeout": 2000,
"preferred-install": {
"typo3/cms": "source",
"svorbeck/masterconfig": "source",
"*": "dist"
}
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
},
"helhum/typo3-console": {
"install-extension-dummy": "0"
}
}
}
ext composer.json:
{
"name": "svorbeck/masterconfig",
"type": "typo3-cms-extension",
"description": "svorbeck master configuration",
"require": {
"typo3/cms-core": "^8.7"
},
"replace": {
"masterconfig": "self.version",
"svorbeck/masterconfig": "self.version"
}
}

Is TagHelper tooling (Intellisense) broken in Visual Studio 2015 with Update 3 and dotnet core 1.1?

I have what I think is a fully up-to-date installation of Visual Studio 2015 Update 3.
If I create a new solution using the "ASP.NET Core Web Application (.NET Core)" template, then select the "Web Application" ASP.NET Core Template with "No Authentication" and wait for it to finish restoring packages, then viewing Razor source files with Tag Helpers shows them in bold purple. A good example is Views\Shared_Layout.cshtml:
However, if I attempt to upgrade it to .NET Core 1.1 following the instructions at the .NET Web Development and Tools Blog then the design-time TagHelper support is lost:
Also missing is all TagHelper Intellisense.
I have SDK version 1.0.0-preview2-1-003177 installed and referenced in the global.json:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177"
}
}
And the project.json looks like this:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "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.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dnxcore50"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
So, what am I missing?
I see there is a similar Issue against the Razor tooling at Github
Razor Tag Intellisense disappears
I do hope there is a resolution...
I came in the morning and the demo project was working as expected. After some head-scratching, I think it's because I forgot to clean and re-build my demo project. I may look like a doofus, but it's a salutatory tale so I'm leaving it here for posterity.
For the record, you certainly do need to reference the Razor tooling twice in project.json:
"dependencies": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
}
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final"
}
:slinks off in shame.

Any way to run the scripts in project.json just like in package.json?

So as the title says, i am wondering if its possible to do the equivalent of "npm run " with the dotnet cli?? e.g. this snippet is from my project.json:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Configuration": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.1.0",
"Microsoft.AspNetCore.Mvc":"1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
//"MySql.Data.Core": "7.0.4-ir-191",
//"MySql.Data.EntityFrameworkCore": "7.0.4-ir-191",
"SapientGuardian.EntityFrameworkCore.MySql": "7.1.14",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"moq": "4.6.38-alpha",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Relational": "1.1.0"
},
"scripts": {
"migrate-identity": "dotnet ef database update --context 'ApplicationDbContext'"
},
The migrate-identity is one i added my self, is it possible to execute this script??
Otherwise i guess i will just have a scripts folder in my project, no big deal, but still :)
Just add the scripts you want in your scripts section in your project.json
"scripts": {
"prepublish": [ "gulp mifiny-js", "gulp minify-css", "gulp remove-non-minified-files" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
I'm using gulp but this is the same with npm
Here is the full project.json schema
As you can see, the scripts section can receive a bunch of different properties corresponding to different events.
"scripts": {
"type": "object",
"description": "Scripts to execute during the various stages.",
"properties": {
"precompile": { "$ref": "#/definitions/script" },
"postcompile": { "$ref": "#/definitions/script" },
"prepack": { "$ref": "#/definitions/script" },
"postpack": { "$ref": "#/definitions/script" },
"prepublish": { "$ref": "#/definitions/script" },
"postpublish": { "$ref": "#/definitions/script" },
"prerestore": { "$ref": "#/definitions/script" },
"postrestore": { "$ref": "#/definitions/script" },
"prepare": { "$ref": "#/definitions/script" }
}
},
Also I see in your comment that you wish to execute them manually. It's possible with Visual Studio at least (never tried VS Code). Just use the Task Runner Explorer. You need to build your project in order to see your npm or gulp tasks.
I'm not able to open it using the shortcut (Ctrl + Alt + Backspace) but the window is also accessible through View -> Other Windows -> Task Runner Explorer
project.json files are no longer supported. However, it is possible to handle it by using XML-based csproj files.
Example:
<Project Sdk="Microsoft.NET.Sdk.Web">
...
<Target Name="MyTarget" AfterTargets="Build">
<Exec Command="echo 'I believe you will see this message right after a successfull building'" />
</Target>
...
</Project>
Result:
For further details:
MS Docs: Mapping between project.json and csproj

dotnet core on Ubuntu Linux using asp.net MVC and EF MySQL error NU1001: cannot restore MySql.Data.EntityFrameworkCore

I've built a simple, flat dotnet core MVC app that I'd like to see running on Linux. It uses EF to pull a few records from a mysql table and display them in a view. It all builds and runs on my host (Win10) but will not in the Ubuntu VM I've spun up to test with
After I do a "dotnet restore", I get the following error with "dotnet build" or "dotnet run":
Project CoreCrossPlatformFlat (.NETCoreApp,Version=v1.0) will be
compiled because the version or bitness of the CLI changed since the
last build Compiling CoreCrossPlatformFlat for
.NETCoreApp,Version=v1.0
/opt/dotnet/corecrossplatform/src/CoreCrossPlatformFlat/project.json(25,52):
error NU1001: The dependency MySql.Data.EntityFrameworkCore >=
7.0.4-IR-191 could not be resolved.
Compilation failed. 0 Warning(s) 1 Error(s)
FYI: Here's what "dotnet --info" reports:
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
For the VM, I followed these instructions:
https://www.microsoft.com/net/core#ubuntu
The project.json looks like so:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
"MySql.Data.Core": "7.0.4-IR-191",
"MySql.Data.EntityFrameworkCore": "7.0.4-IR-191"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Here's a zip of the solution if that helps:
https://s3.amazonaws.com/kilonova-public/code/CoreCrossPlatformFlat.zip
Encountered the same problem today. Please try deleting all files and folders except the project.json file and all the .cs files in your project folder. Then dotnet restore and dotnet run. It works for me. : )