Visual Studio 2017 (15.5.2) bower missing under dependencies - visual-studio-2017

So i just installed a clean version of Windows 10 and Visual Studio 2017 Community.
Trying to create a brand new ASP.NET Core 2.0 project i saw that Bower is missing under the Dependencies node.
Bootstrap and jquery packages are already installed but i cannot manage them and cannot seem to find a configuration file either.
I searched the web for this problem but didn't found nothing useful.
Is there an issue with the VS 15.5.2 update? How can I fix this?

This is very annoying, but I guess the Manage Bower Packages context menu is now enabled only when you have the respective bower configuration file (bower.json) and right-clicking it.
Just create a new file bower.json and .bowerrc in the root directory project (nested solution) as respectively showed below:
{
"name": "asp.net",
"private": true,
"dependencies": {
}
}
{
"directory": "wwwroot/lib"
}
A good hint to create any file is using Mads Kristensen's extension Add New File (SHIFT + F2) already embedded in Web Essentials Extension (recommended) also created by him.
So, right-click bower.json.

Related

Theme and Icons Problem with GTK3 Installed with vcpkg

I am using Visual Studio 2019 on Windows 10 and am trying to use GTK in C++ and installed it using vcpkg.
I've installed GTK using vcpkg according to the guide from GTK. I'm using Visual Studio 2019 and it is able to compile and run the example program here, but there is an issue regarding the theme and icons. According to the installation guide, under the section Building and distributing your application there are some things that must be done to get themes and icons to work.
I've started by downloading the Windows theme the guide suggests and have it in a share directory and then I've created a settings.ini file in an etc directory. It says to place this in the "install directory", which I assume is where Visual Studio is placing the exe for the program. I've tried it in both build and release, in the source files, in the top project directory - all with no success (and I did make sure it is targeting x64).
Just in case I also tried placing these where vcpkg is installed as well as where vcpkg installs gtk. No luck. When the program runs I get the warning
(gtkExample0.exe:16772): Gtk-WARNING **: Could not find the icon 'window-minimize-symbolic-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
So it seems that it is never finding the ssettings.ini file telling it to use the Windows 10 theme. Has anyone had any luck with getting this to work (both from VS2019 debugging runs and in deployment)?
To summarize the files:
share\themes\Windows10\gtk-3.0\gtk-3.20\ (downloaded from suggested GitHub repo)
etc\settings.ini contains:
[Settings]
gtk-theme-name=Windows10
gtk-font-name=Segoe UI 9
I've placed these in
<VS2019Project>\x64\Release,
<VS2019Project>\x64\Debug,
C:<path_to_vcpkg>\vcpkg\packages\gtk_x64-windows,
C:<path_to_vcpkg>\vcpkg\installed\x64-windows
All with no change when running from VS2019 under Release or Debug.
Theme and icons considered as external resources are not distributed by vcpkg, and the instructions given in the distribution guide from GTK regarding where these resources should be layout on windows 10 are not crystal clear. The problem has also been reported here vcpkg issue#4417.
The solution proposed hereunder is to install
all the resources in the <VS2019Project>\x64\Release directory of your VS project where your .exe application lives [This is a local solution the problem. A global approach should consider the setting of some user-defined free desktop environment variables which is not discussed here]. Icons can be picked from an ancillary MSYS2 distribution and the theme as indicated in the GTK Guide. The solution should be replicated for the Debug branch.
Supposing you have MSYS2, install mingw-w64-x86_64-adwaita-icon-theme package with the pacman package manager if not already done on your MSYS2 installation pacman -Syu mingw-w64-x86_64-adwaita-icon-theme.
Copy C:\msys64\mingw64\share\icons to <VS2019Project>\x64\Release\share\icons
you should get both hicolor and Adwaita icons as subdirectories of your target dir.
Copy the theme resources downloaded in the source gtk-3.20 directory directly into <VS2019Project>\x64\Release\share\themes\Windows10\gtk-3.0\. Do not locate these resources into a gtk-3.20 subfolder: to understand why consult this article Theme Location [assuming here that no global desktop environment variable has been set].
Create a <VS2019Project>\x64\Release\etc\gtk-3.0 directory, put your settings.ini into it.
Recompile and you should obtain a windows 10 look and feel for your application window.

Visual Studio / Xamarin.Forms Errors on New Project

I was working on a Xamarin.Forms project for weeks - everything compiled and I was able to distribute. The last things which happened as of 05/20, were 1) a Windows 10 update occurred, and 2) I did a VS 2017 update.
Now the entire project has this "type or namespace 'system'..." error on everything. This is happening 1) upon creating a brand new project and 2) before doing anything - even compiling. Just opening the "App.xaml.cs" file after a few seconds highlights all these things in red in the IDE
A screenshot of partial list of the "App.xaml.cs" file and the errors is here:
Other Info
I right-clicked solution and chose "restore nuget packages" - no change. I "cleaned" the solution - no change. I rebuilt... no change.
I am continuing to research and one clue which may help is that I can see the "NETStandard.Library" package in Nuget "installed" section shows "2.0.3" yet my common Xamarin.Forms project shows "2.0.1" and the drop-down of versions shows anything else is "blocked by project".
The other 3 projects, "Android", "iOS", and "UWP" will let me choose and install "2.0.3". I tried that once and then got a message about "mixed versions". At this point, I do believe the issue I'm seeing is related to this "NETStandard" package.
Cannot figure out how to make a brand new project load/use/install "2.0.3" instead of "2.0.1".
I was actually able to install the 2.0.3 version by opening the nuget package console and installing the package to the individual projects one at a time using the command Install-Package NETStandard.Library -Version 2.0.3 -Project ...
I had this problem like you and i solved this problem by add 2 package in package source.
In Visual Studio go to Tools -> NuGet Package Manager -> Package Manager Settings. Here select the Package Sources tab in the tree on the left. You should see the following:
enter image description here
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
Name: LiveReload
Source: https://nugetized.blob.core.windows.net/Live-reload/index.json

.NET Core React Project Doesn't See NPM modules

I'm trying a React/Redux .NET core (2.0) web project in Visual Studio 2017. And I've installed font-awesome using npm. It's there and I can see it in the node_modules folder, but I'm not sure if the web project should see it automatically or if I have to drag it into my dist folder and edit my layout page to see it. I'm not against doing that, but as a VS programmer, I'm used to things being a bit more automatic mainly for the sake of package updates. I'm not really confortable editting the vendor.js or vendor-manifest.json files.
Anyone know what I'm doing wrong? (no guesses, please.)
I was looking for an answer to a similar question and came across FA's package specifically for React. They have some good instructions on this page.

Netstandard.Library 1.6.1 blocked by project

I've created a brand new solution and project in VS2017 RC and for some reason I can't use the latest version of the NETStandard.Library package.
There's no code in the project and it's the first project in the solution.
When in the NuGet package manager it's listed in the dropdown, but marked as blocked by project.
Any ideas?
You need to execute the command in Package manager console for your project
Install-Package NETStandard.Library
The NETStandard.Library package is no longer meant to be upgradable through the package management UI. The "SDK" component of the project emits this reference automatically and marked read-only.
This behaviour can be overridden through a property in the csproj file:
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
If you delete a line like this from your csproj file, you'll get the newest version that VS or the CLI knows about.
This property is usually added when migrating from project.json to csproj. In this case, you can safely remove it.

How to create nuget package for native C++

I want to publish package about sdl_mixer, it's a native package. I did as tutorial said. I put .dll .hand .lib files into package content, but the final package didn't work. So what is right way to create c++ nuget package?
Another question: I found in nuget, most native c++ package are published in two packages, for example:
sdl2_ttf.v140
sdl2_ttf.v140.redist
What is difference between those two files? And how can I publish my packages like that?
Update:
I followed the tutorial on how to publish native packages. I have written the following autopkg file
nuget{
nuspec {
id = MySdl_mixer;
version :2.0.0.0;
title: sdl mixer;
authors: { Sam Lantinga, Stephane Peter, Ryan Gordon};
owners: {spartawhy117};
licenseUrl: "http://libsdl.org/license.php";
projectUrl: "http://libsdl.org/index.php";
iconUrl:"";
requireLicenseAcceptance:false;
summary:Nothing;
description: #"SDL_mixer is a sample multi-channel audio mixer library....
";
releaseNotes: "Release of C++ ";
copyright:Copyright 2015;
tags: {v140 ,sdl_mixer , native, CoApp };
};
files {
#defines {
Include = include\;
Bin = bin64\;
Lib = lib64\;
}
include:{"${Include}*"};
[x64,v140,debug,desktop]{
lib: ${Lib}SDL2_mixer.lib;
bin: ${Bin}SDL2_mixer.dll;
}
[x64,v140,release,desktop]{
lib: ${Lib}SDL2_mixer.lib;
bin: ${Bin}SDL2_mixer.dll;
}
};
targets {
Defines += HAS_SDLMIXER;
};
}
Running the command Write-NuGetPackage .\sdl_mixer.autopkg returns an error unexpected input of the end. What is the problem here?
I searched around for days until I found there is really no help out there on the internet at all. I did managed to piece together how to do it, and through trial and error got it working well. Which I have documented here:
https://digitalhouseblog.wordpress.com/2019/08/22/how-to-make-a-nuget-package-for-c/
But I'll summarize here anyways:
Gather or stage your native library files into a folder of your
choosing.
Create a *.nuspec file in that folder.
Edit the *.nuspec file to include the files you want to include in your package.
Create a *.props file
Call nuget pack to create the package.
Push the nuget package to a feed somewhere.
Create a packages.config file.
Edit the visual studio project file to import the *.props file
Notice that the nuget tools inside the visual studio IDE are NEVER used. You have to do a LOT manually. See the link for full details and explanations.
You can use CoApp PowerShell tools to create the Native Nuget packages easily.
Creating Native Packages
If you’re interested in publishing your
native libraries via NuGet, you can choose to create the NuGet
packages manually. However, there’s an easier way--the CoApp project
volunteered to write C++ oriented tools to create NuGet packages, and
they have released a beta version of their tools. These tools simplify
the process of generating the MSBuild files and NuGet packages from
existing header and library files--you just need to create a
configuration script to describe the contents of the package and then
run the tools to generate the NuGet package.
Refer to this link for more detailed information: Support for Native Projects.
If you want to do this from Visual Studio C++ using a Visual Studio Solution and projects.
Look at my answer here.
Create Nuget package for C++/C Visual Studio Solution projects
The above question seems to be Linux.