Cannot update Azure Devops (VSTS) extension - azure-devops

In the Visual Studio Marketplace (https://marketplace.visualstudio.com) I found an extension (version 1) that I now use in my Azure Devops build pipeline. I contacted the author who made a small improvement and the new version of the extension was pushed yesterday. In the VS MarketPlace I also see that v2 has become available. However, when I go to my build pipeline I can still only select version 1.
I've contacted my organization's admin to ensure that the latest version is installed. We have even tried to remove the extension for the organization (at which point that was reflected in my build definition) and re-install it, but still I can only select version 1.
Any ideas why I cannot access the latest version of the extension?

In my case, the problem was not updating the task version in task.json file. Updating the extension's version (in the manifest file) is not enough. If the task version is not changed, Azure DevOps will not update the task itself (despite correctly updating the extension on the "Extensions" page).

Did the extension bundle multiple versions of tasks? Generally, we include one version of a task in your extension. Now it is also possible to include multiple versions in one extension, it is helpful if you want to roll out future versions of your extension without interrupting service of users running older versions. You can see the multiple version layout. You can only select version 1, that means the extension include only one version task, even you updated the version number in the task schema. In other word, the version you can select is not the version of the task itself, it means in this extension includes how many different version task.
Please see following example extension manifest which includes multiple version task.
{
"manifestVersion": 1,
"id": "build-release-extension-task",
"name": "Build and Release Extension Tools",
"version": "0.1.0",
"publisher": "{your publisher id}",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "Tools for building/releasing with Fabrikam. Includes one build/release task.",
"categories": [
"Azure Pipelines"
],
"icons": {
"default": "images/ic_extension.png"
},
"files": [
{
"path": "buildAndReleaseExtensionTaskV1"
},
{
"path": "buildAndReleaseExtensionTaskV2"
}
],
"contributions": [
{
"id": "custom-build-release-task-v1",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "buildAndReleaseExtensionTaskV1"
}
},
{
"id": "custom-build-release-task-v2",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "buildAndReleaseExtensionTaskV2"
}
}
]
}

Related

Why is syntax highlighting not showing for my custom extension in VS Code?

I am trying to create a custom language-extension for VS Code. I was mostly following the instructions given here and here.
When I run the extension in the Extension Development Host by hitting F5, everything works fine. As soon as I try to install my extension and use it in VS Code, it does no longer.
From here I gathered that I have three options of installing my extension
bundle my extension to a vsix with vsce and install it from within VS Code
install the vsix package from command line with code --install-extension myExt.vsix
copy the content to a folder in %userprofile%\.vscode\extensions
All three options give the same result: syntax highlighting does not work for keywords, etc. but it does work for comments. Using the Scope Inspector I can see that all the tokens are correctly deteced and categorized, so the extension seems to be basically working, but code is not highlighted (again, except for comments, weirdly).
The only clue I get when I install via command line is
Installing extensions...
(node:34352) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Extension 'vscode-knitout.vsix' was successfully installed.
but I doubt that this has got anything to do with the problem.
This here is my package.json file:
{
"name": "vscode-myLanguage",
"displayName": "myLanguage",
"description": "myLanguage language extension for VS Code",
"version": "0.0.1",
"publisher": "me",
"author": {
"name": "name"
},
"icon": "images/icon.png",
"galleryBanner": {
"color": "#C80000",
"theme": "dark"
},
"engines": {
"vscode": "^1.53.0"
},
"license": "SEE LICENSE IN LICENSE.txt",
"repository": {
"type": "git",
"url": "https://some.git.url"
},
"homepage": "https://our.website",
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [{
"id": "myLanguage",
"aliases": ["myLanguage", "myLanguage"],
"extensions": [".m",".myLanguage"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "myLanguage",
"scopeName": "source.myLanguage",
"path": "./syntaxes/myLanguage.tmLanguage.json"
}],
"themes": [
{
"label": "myLanguage-dark",
"uiTheme": "vs-dark",
"path": "./themes/myLanguage-vs-dark-color-theme.json"
}
]
}
}
When I run via Extension Development Host, the Scope Inspector correctly recognizes the language and textmate scopes and respective theme rule for 'foreground'. When I run VS Code with the extension installed/copied, the Scope Inspector says "No theme selector" for 'foreground', but everything else (scope, language) looks correct.
What is the problem here? Is there a very simple example somewhere for a reference?

Application dependency not found while release by the build agent

My .NETStandard library works fine locally on Visual Studio. But, when I release the WebApi containing my .NETStandard library the release proces failed on the EF Core Migrations step.
I use the Deploy Entity Framework Core Migrations release task by #bendayconsulting. The error message I receive is n assembly specified in the application dependencies manifest (MySecondMobileApp.ServerData.deps.json) was not found:
package: 'Google.Protobuf', version: '3.5.1'
path: 'lib/netstandard1.0/Google.Protobuf.dll
When I look at the packages folder at my solution there is no Google.Protobuf assembly. The assembly is stored at my global NuGet folder and is part of the MySql.EntityFrameWorkCore NuGet package. The MySql.EntityFramworkCore package is also installed at my user's global NuGet folder. How can I get these packages in the solution's folder? I think that is the answer of my problem.
My deps file looks like this:
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.0/",
"signature": "19d3dd659b5fa2adabeefcff78ce8381da3d4fe9"
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"ClassLibrary1/1.0.0": {
"dependencies": {
"Google.Protobuf": "3.6.1",
"NETStandard.Library": "2.0.3"
},
"runtime": {
"ClassLibrary1.dll": {}
}
},
"Google.Protobuf/3.6.1": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
"runtime": {
"lib/netstandard1.0/Google.Protobuf.dll": {
"assemblyVersion": "3.6.1.0",
"fileVersion": "3.6.1.0"
}
}
},
"Microsoft.NETCore.Platforms/1.1.0": {},
"NETStandard.Library/2.0.3": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
}
}
},
"libraries": {
"ClassLibrary1/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Google.Protobuf/3.6.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-D/h9IZl76jjfM5VlPzG235Zdys9RKXNLYbRGm2fa6Y2UshTqAvYBPIydNOvNTEa24DER/m/zvelHlLO9n1GtNQ==",
"path": "google.protobuf/3.6.1",
"hashPath": "google.protobuf.3.6.1.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
"path": "microsoft.netcore.platforms/1.1.0",
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
},
"NETStandard.Library/2.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"path": "netstandard.library/2.0.3",
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
}
}
}
Configure a package management feed (Azure Artifacts) and push your internal packages to it, then use a NuGet restore task in your build prior to building to restore the packages from your internal feed.
Finally, I resolved this problem. First, I will apologize from my incomplete question. I had to told stackoverflow my whole problem. My base problem is that I couldn't release my WebAPI containing EntityFrameworkCore for MySql on a Hosted2017 build agent in Azure Devops. The Build Agent also excutes the database migrations.
After some thoughts I relealized that a MySqlConnection not is supported by .NET by default -> you have to install additional client software on the build agent. Unfortunately the Microsoft build agents don't have the capability to establish a MySQLConnection between the build agent and the MySQL database server.
What completely vage is for me at this moment is the fact that the API WebServer on AWS supports this databaseconnection by default. My WebAPI is working perfect on the webserver.
The solution for me to make the build agent work with MySQL was to install an on premise build agent and install MySQL Workbench to install the MYSQL software.
Now the build agent is working fine. The migrations are successfully executed.

Configure Visual Studio Code to have a default Build Task based on file extension

I would like to know if there is a way to define a default Build Task for VSCode depending on file extension.
When working in some folder of Python code, I define the following Build Task:
{
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"showOutput": "always",
"args": ["${file}"]
}
Then if next time I go to another Python folder, I have to redefine it again.
Is it possible to configure VSCode in such a way that if it detects the current file as a Python script, then it will automatically define the above Build Task?
Thank you in advance for your help!
Update for latest vscode
The following will create a default "build" script, so you can use the keyboard shortcut to build your project. (Below for a javascript project, but shows general outline for other languages/projects.)
(1) Assuming you have a script named "build.js" at the root of your project.
(2) Create a file named "tasks.json" in root of project (workspace) with the following contents:
// tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "mybuildscript", // use same name as in package.json
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
(3) In your package.json, add "scripts" as:
// package.json
{
"name": "my",
"version": "1.0.0",
"description": "",
"scripts": {
"mybuildscript": "node ./build.js"
},
"dependencies": {
"myfs": "^1.0.22"
}
}
I created a rudimentary vscode extension that does all this for you:
https://marketplace.visualstudio.com/items?itemName=gieson.make-build-task
The extension isn't perfect (doesn't cover all the possible ways a project/workspace can be configured), but it's a good starting point.
Here's the repo:
https://github.com/bobtherobot/make-build-task
This is possible, but it requires writing an extension (unless somebody has already written one with a tasks provider for Python). Since 1.14.0, there's a new API which allows extensions to dynamically provide tasks. Check out the Task Provider Example.
Alternatiely, the Code Runner extension probably does the trick in this case as well. It doesn't use the Tasks system though.

Version drop down in VSTS build definition

I have noticed a drop down with a version number in my build definition, this appeared few week ago(perhaps after a VSTS upgrade) in all of the build definitions. I could not find any reference for this in MSDN, Please explain the purpose of this.
Thanks in advance.
This means the version of this build task. Some steps have more than one version for you to choose, such as "Visual Studio Test", "Copy Files" steps, etc. Some steps still have one version, like the "Nuget Installer".
You could choose different version of the step by clicking the dropdown list. If a new version of the step added, you will see a red flag beside it.
Update:
In the manifest file(the task.json file), set the version and preview like the below:
"version": {
"Major": 2,
"Minor": 0,
"Patch": 1
},
"demands": [ "vstest" ],
"preview": "true",
The "Major" set to 2 and the "preview" set to true, you will see "2.*(prview)" in your task.

Composer package not found in any version

I am trying to create a custom vendor package but have not yet put the package on packagist. According to the docs, the package can be loaded from git (vcs) instead of packagist: https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository
The yii2 project (although don't think framework matters) I have created package inside vendor folder:
foundationize/yii2-foundation
(folder structure is as above, I have quadruple-checked).
My root public_html/composer.json has following entries:
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.5",
"yiisoft/yii2-swiftmailer": "*",
"foundationize/yii2-foundation": "dev-master"
},
My package composer file, vendor/foundationize/yii2-foundation/composer.json looks like:
{
"name": "foundationize/yii2-foundation",
"description": "The Foundation extension for the Yii2 framework",
"keywords": ["yii2", "foundation"],
"type": "yii2-extension",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/foundationize/yii2-foundation/issues",
"wiki": "https://github.com/foundationize/yii2-foundation/wiki",
"source": "https://github.com/foundationize/yii2-foundation.git"
},
"authors": [
{
"name": "gvanto",
"email": "gvanto#hotmail.com",
"homepage": "http://foundationize.com"
}
],
"require": {
"yiisoft/yii2": "*"
},
"autoload": {
"psr-4": {
"foundationize\\foundation\\": ""
}
},
"repositories": [
{
"packagist": false,
"type": "vcs",
"url": "https://github.com/foundationize/yii2-foundation.git"
}
]
}
When I run composer install (or update), I keep getting error below:
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- The requested package foundationize/yii2-foundation 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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion
for more details.
Read https://getcomposer.org/doc/articles/troubleshooting.md for
further common problems.
I have googled it high and low, read the docs can't seem to get it to work (always the same error, which I actually think would be more useful if it said either the package was not found OR the incorrect package version was found).
You have to add the repositories entry to your root composer.json file. Otherwise, Composer does not know where to search for your package.
Had a similar problem to this and it was because I was running composer in the /web directory in the new Drupal structure. When I ran it in the root all was fine. Annoyingly, you need to run Drush in /web
Since Laravel version 5.5 there is a Package Auto-Discovery feature, so there is no need to add service provider. All you need to register package like this:
composer require barryvdh/laravel-debugbar:dev-master
You can find more info in these articles:
https://medium.com/#taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518
https://divinglaravel.com/laravels-package-auto-discovery