The procedure is supposed to be this way:
Right click on the project -> New element -> Select Bower configuration file
The problem is after picking New element I can't find Bower configuration file.
Even when I type "bower" in the search list i get nothing.
Right click your project solution -> Add New Item -> select Web on the
left -> select Bower Configuration File on the list -> Add
Now you can install new bower package by right click your solution ->
manage bower package.
More Information
If above is not working :
Just add bower.json file to root of your project, you will see the Manage bower packages ... in the right click context of your web project. (even an empty file will work)
Open Visual Studio 2019 ---> Search ---> bower configuration file
In my case the file never appeared on the template list so I had to add a simple Text File and named it "bower.json" then add this code:
{
"name": "asp.net",
"private": true,
"dependencies": {
"boostrap": "4.4.1" //This is for my project
}
}
Then add another TextFile and named it ".bowerrc" and add the directory for the packages:
{
"directory": "wwwroot/lib"
}
When I saved the files the Dependencies folder recognized it.
Related
Go-to-definition functionality not working on vs-code.
I have installed cucumber(gherkin) full support plugin.
Steps to replicate: Right click on steps on feature file and select go to definition.
Feature file
Gherkin code : When user access the Application
Step definition file
When('user access the Application', async function () {
await PageObject.open();
});
Expected: It should navigate to step-definitions file.
project folder structure
settings.json
install plugin: Cucumber (Gherkin) Full Support (Alexander Krechik)
create a folder: .vscode under project folder (don't in any subfolder)
create a file: settings.json under .vscode
In vscode, reopen the folder where .vscode insides to make settings take effect.
Following is the example project on my local and the go to definition worked well on it.
project folder structure
settings.json
{
"cucumberautocomplete.steps": [
"steps/*js"
],
"cucumberautocomplete.syncfeatures": "features/*feature",
"cucumberautocomplete.strictGherkinCompletion": true
}
(Remember change to your step definition and feature file path)
I am trying to browse code for gVisor with VScode.
However, unlike other Go projects, gVisor is built with bazel, and the source code is not located under $GOROOT or $GOPATH. Maybe this prevents gVisor packages from being searched by VSCode go extension. Go-to-definition is not working in most cases, except for cases where the definition can be found under the same directory.
How can I setup VSCode with bazel Go projects? Especially gVisor. Thanks!
The linked gVisor rule now proxies a more canonical implementation
This setup worked for me:
In your workspace's root BUILD file you can add the following build rule
# in BUILD.bazel
load("#io_bazel_rules_go//go:def.bzl", "go_path")
go_path(
name = "gopath",
mode = "link",
deps = [
"//my/binary/here",
"//any/other/binaries/you/want/linked",
],
)
(if you don't yet have a gazelle import for the bazelbuild/go_rules, you would need to import it for bazel)
# in WORKSPACE
http_archive(
name = "io_bazel_rules_go",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
],
)
Build this command to create a symlinked folder in your blaze-out at bazel-bin/gopath that contains links to each of your dependencies. You'll have to do this any time you add a new dependency. You will see a line for each symlink created.
bazel build :gopath
(assuming you're using VSCode with the Golang extension) Set your workspace settings for the go extension to point to this gopath. Note you'll need to have it be a worspace trusted extension in order for this to work.
// In .vscode/settings.json
{
"go.gopath": "/YOUR ABSOLUTE PATH TO YOUR WORKSPACE//bazel-bin/gopath"
}
Restart VSCode
Enjoy!
NOTE: if you have a go.mod file in your root dir, this will not work.
gVisor recently added a gopath BUILD rule that creates a canonical GOPATH tree from the source.
You may be able to use that the edit more effectively from VScode.
recently I started learning ASP.Net core MVC. I always used bower to install packages for my projects in Visual Studio 2017. but now I want to use yarn. since it seems bower is deprecated. but I don't know how to use yarn to install bootstarp in wwwroot folder. for bower i used bower.json and it would install bootstarp automatically. I use "yarn add bootstrap#4.0.0-alpha.6 --dev" but it install it in node_modules in the project folder and I can't see it in the solution explorer,
thanks
It's best to use npm(a package manager) for Asp.net core application,start by searching and adding a package called npm by right clicking on your project name in solution explorer in vs2017 and clicking on "add" => add new item",inside the package,add in your bootstrap as a dependency as showed below,
{
"version": "1.0.0",
"name": "nameofyourapplicationinsmallcaps",
"private": true,
"devDependencies": {
},
"dependencies": {
"bootstrap": "4.1.0"
}
}
Next ==> Create a root folder within your project named middleware,you would be building a custom extension/midleware(these would look into the node module folder to serve up files) in your request pipelines inside of startup.cs ,ensure you place the new extension which can be named app.UseNodeModules() underneath the app.UseStaticFiles() middleware( these serves up files from the wwwroot folder) as showed below,
app.UseStaticFiles();
app.UseNodeModules(env.ContentRootPath);
Inside the middleware folder,add a class which can be named ApplicationBuilderExtensions.cs , you would be creating a app.UseStaticFiles() with its own request path pointing to the npm package,add the below to the class(you wont be using the default app.UseStaticFiles()),
using Microsoft.Extensions.FileProviders;
using System.IO;
namespace Microsoft.AspNetCore.Builder
{
public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseNodeModules(this IApplicationBuilder app , string root)
{
var path = Path.Combine(root, "node_modules");
var fileprovider = new PhysicalFileProvider(path);
var options = new StaticFileOptions();
options.RequestPath = "/node_modules";
options.FileProvider = fileprovider;
app.UseStaticFiles(options);
return app;
}
}
}
Next ==> look for an icon inside of your solution explorer in vs2017 named "show all files" and click it,you would see a node_module folder,expand this folder to view bootstrap=>dist=>css, drag the bootstrap.css in between the opening and closing head tag in your _Layout.cshtml.
After doing all these, you can start making use of bootstrap classes to add styling to your project.
I want to install a package into my local project.For that I'm creating a composer.json file in my project folder is given below, it gives the total vendor folder of that package into my custom folder in my project. Its working fine.....
{
"config": {
"vendor-dir": "/var/www/html/Test2/Testing/Down"
},
}
It gives the package into 'Down' folder.
But, now I want the sub folders or files in that packages to be installed in my custom folders like js/css folders in my project.
For example i want jquery.js file into my local folder path
/var/www/html/Test2/Testing/assests/js
From the package "frameworks/jquery".
For that, what changes are needed in my composer.json file?
Composer is used to bring in packages to support the PHP code of a project, here is how they describe it on the Composer website:
Composer is a tool for dependency management in PHP. It allows you to
declare the libraries your project depends on and it will manage
(install/update) them for you.
In other words, if you need to do logging in your PHP code and decide to use the publicly available monolog package, you use composer to bring that package into your project, then in your PHP code, you can call monolog functions.
Using config to rename the vendor directory is trying to use Composer in a way that doesn't fit the intent of the tool. The vendor directory is used to hold the packages brought in (such as the monolog code). The vendor-dir value is simply renaming that directory.
Since you have GitHub listed as a tag, you could possibly use cloning to get your files to your website directory.
I've modified my composer.json file, it looks like the below:
{
"config": {
"vendor-dir": "/var/www/html/Test2/Testing/Down"
},
"require": {
},
"scripts": {
"post-package-install": [
"php -r \"exec('cp -r /var/www/html/Test2/Testing/Down/frameworks/jquery/* /var/www/html/Test2/Testing/assets/js');\""
]
}
}
It will gives all selected files in a package to my local folder.
Briefly the files in the folder 'frameworks/jquery' are copied into my local 'assets/js' folder.
I'm trying to install the Android SDK from Kontakt into a project in Android studio. I'm following the (seemingly basic) instructions on the Kontakt site here:
http://docs.kontakt.io/android-sdk/quickstart/#installing-the-sdk---android-studio
In brief, these steps say add maven { url 'http://repo.kontakt.io/repository/internal/' } in the repositories in your top-level build file, and add to add compile 'com.kontakt.sdk.android:library:1.0.5' in the dependencies in the main module build file.
However, when I try to sync my project with the updated files, it fails with an error message:
Error:Failed to find: com.kontakt.sdk.android:library:1.0.5
I tried with a totally fresh project and the same issue.
I'm guess this all has something to do with the fact that the instructions are written for Android's 0.12 version of the Gradle tools, but I'm using v1.1.0. I'm not across the detail of Gradle, so so any help would be appreciated.
My guess is that path to Kontakt.io public repository should be added to allprojects section instead of buildscript.
allprojects {
repositories {
jcenter()
maven { url 'http://repo.kontakt.io/repository/internal/' }
}
}
I am not 100% sure so don't shoot me:P
I think adding this line:
-->compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.kontakt.sdk.android:library:1.0.6'
Directly above the gradle project I wanted to compile fixed it.
Go to the Kontakt.io Android Proximity SDK https://github.com/kontaktio/kontakt-android-sdk on GitHub.
Click the Download ZIP button
Un-zip the file to a temporary location.
Add the jar file in your Android Studio Project.
File -> New Module -> Import .JAR/ .AAR Package -> Click Next -> Browse the SDK path (2.1.1) -> Finish (Take time to add in the project)
Then, Add module in dependencies
Right Click on Project Name -> Open Module Settings -> Under the list (Modules) -> Click on Dependencies -> Click on '+' -> Module Dependency -> Add Kontakt.io-android-sdk
Now Build your project It worked for me to kontakt io SDK. If anybody find the way to do this as Gradle build, please let me know.