Solution explorer menu in Visual Studio 2015 is missing jspm packages and config.js - asp.net

I'm following an aurelia tutorial with Visual Studio 2015 and ASP.NET core where I installed NPM and run JSPM init, but after successfully creating all the files I can't find the jspm packages or config.js file in my Solution explorer.
UPDATE 1 The hidden folders and files are now showing up, but I have to right click on the main directory and chose the option to add to existing item. As you can see from the image I have a lot of files and folders, how can I speed up the process? Is there a way to just add all files to the project at the same time instead of manually?
Note: The config.js and jspm packages are on my physical directory so I know they exist, but how can I make them show up on my solution explorer menu?
STEPS:
I opened cmd prompt and entered: jspm init + npm install jspm --save-dev and selected yes on everything except on the configuration file part I entered: wwwroot and enter yes on everything, then selected babel.
Please let me know what I should do to make the files show up on the solution explorer or at least point me in the right direction. Thank you.

Originally VS projects did not automatically include new files that were added to the Project directory manually outside of Visual Studio.
However, I find that with VS2015 Update 3 and a new AspNet Core project they do "automagically" show up.
Not sure if maybe you're on a slightly older build, etc. but you could try the older approach as follows:
Select the Project in the Project Explorer (you currently have a solution-level item selected in that screenshot) and then you will see a new icon appear in the row of icons across the top of the Solution Explorer. This is the "Show All Files" icon/button.
Clicking it will show items that are in the physical directory but are not part of the VS Project. You should be able to right-click the file an choose include in project (or at least you used to be able to do this in older projects, etc. as stated).

Related

Update bootstrap in an asp.net core web application + Angular project

I have created a sample project using Visual Studio 2017. The project is ASP.NET Core Web Application with Angular (the Angular template comes with the latest VS2017). The project was created and is working great.
I would like to update the bootstrap to the latest - what would be the best way to do that? I have tried copying over, importing in _Layout.cshtml and Index.cshtml but fails...
I am pretty new in this area, so any help would be greatly appreciate.
Thanks
Working with an empty solution here, but should be the same.
In your solution explorer, under Dependencies, there is a "npm" folder.
Right click on the folder and click "Open package.json"
Find "bootstrap" under devDependencies, and change the version to the one you want.
Pressing Ctrl+Space should show you the latest stable version if you just want the latest
If it doesn't automatically update the package for you then:
Go back to, and open the "npm" folder in the solution explorer.
Find bootstrap, and right click and select "Update Package"
Let me know if I missed anything.

Atom Editor - Open File and treeview works not as expected

I am using ubuntu 14.04 LTS and Atom Editor 1.5.3
If I and click on Open File I want that the dialog window shows the directory of the current file I am working on. However, it always shows the directory Recently Used and I have to click through the folders to get to my project folder. Where can I change this so that the dialog window starts in my project folder?
Also I noticed that the treeview doesnt change if I work on a specific file. So if I have two projects folders called Project 1 and Project 2 and I start with a file from folder Project 1 then I see the treeview of this folder. However, if I open a file from Project 2 and work on this file, the treeview of folder Project 1 remains. How can I make that the treeview always corresponds to the current file I am working on?
As for the first part of your question, this is a bug in atom for the linux version. Someone has suggested a patch but it seems it has not been accepted yet in the main atom version, even if it seems to work (see the discussion). The two commits are here, if you want to try something with them (what would imply something like recompiling atom yourself of course...).
About the second part of the question: I don't think it's possible to let atom switch automatically from a project to another when clicking on a file. But you can use the project manager package, what will allow you to define projects, and to set a root directory for each project and then switch from a project to another manually. The treeview will then fit with the current project.

Visual Studio 2015 Ignoring New Folders & Files

When I add a folder to the visual studio project, it ignores it completely. It didn't do that until recently, and I am not entirely sure why this is. A clean build does not solve the problem, in the visual studio folder structure, the resources folder is present.
And in the latest build it is completely ignored.
To show it is not exuded from the project:
If the files are missing on a build server check the files are committed to your source control.
If the folder is empty, its not clear in your question if it is or not, you can either add a dummy.txt file or follow the instructions listed here. How to force MSBuild to copy empty folders in project?
If the files are missing from a publish you need to select all the files you want to publish, and change the "Build Action" to Content.
You cannot directly select a folder, you need to select the individual files.
Interesting post about the different options for build action:
What are the various "Build action" settings in Visual Studio project properties and what do they do?
Side Note
If you want your files to be published to the output direct on build. I.E. the bin folder. Then set the "Copy to Output Directory" to copy always or copy if newer.
Not sure why you would want to do this for css files though.
In the Visual Studio Solution Explorer right-click on on each files under resources folder and
select Properties > set build action to content.
I had to click the show all files button below the "Solution Explorer" text to see that I wasn't including anything.

exclude folder in project.json

in the new asp.net 5 template there's a project.json in which you can exclude certain directories.
"exclude": [
"wwwroot",
"node_modules",
"bower_components",
"dist",
".tmp"
]
As you can see, I added a few folders like 'dist' and '.tmp', but they are still included in the solution explorer. There's not much documentation about this. How to exculde files/folders from your project in vs 2015?
The "exclude" property does not hide the folder from visual studio, it will not make the folder "disappear" from the solution explorer.
The "exclude" property removes the folder from the compilation search path. It is an instruction to the compiler (Roslyn) not the IDE. As a more comprehensive answer "project.json" is intentionally IDE agnostic. That is why there is both a projecname.xspoj and a project.json which both contain project configuration information. This is necessary to allow for more robust cross IDE and cross platform development.
You can verify this behavior yourself with a simple excercise.
Add a new class file (buildfail.cs) to your existing project (or
create a new project) in the root project folder.
Ensure buildfail.cs has the same namespace as the other source files in the
project, contains compilation errors, and is in the root directory.
You should see build errors in VS. If you don't manually build.
Create a new folder (excludeme) off the project root and move
buildfail.cs to that folder. You should still have build errors.
Add excludeme to the exclude property in project.json. The build errors should be removed because builfail.cs is no longer in the build search path.
You may be wondering what is VS using to know to hide the node_packages folder from the Solution Explorer display. I am unsure and it may not be user configurable but it isn' the exclude property. Comment out node_packages in project.json and you will get build errors (package restore failure) but the folder will still be hidden from Solution Explorer. Since this is IDE specific behavior one would assume that maybe it is defined in projectname.xproj but I found no such property so at this time it would appear to be black box magic by VS.
As of Asp.Net 5 beta-8 and complementary tooling update to Visual Studio 2015, you are now able to exclude/hide folders from being displayed in solution explorer. More information about this, and other changes are outlined in the announcement post. To hide a file or folder, right-click to bring up a context menu and select Hide from solution explorer. This creates an entry in the .xproj file:
<ItemGroup>
<DnxInvisibleContent Include="myhiddenfile.txt" />
</ItemGroup>
Note also that there has been a change to where bower packages are installed by default. Previously, the Asp.Net 5 templates in Visual Studio would install bower packages to a folder called bower_components, a practice familiar to web developers who do not use Visual Studio. However, apparently due to developer confusion, this has been changed to wwwroot/lib. This can be changed by editing the bowerrc file. As such, the bower_components folder does not exist in the new beta-8 templates. Please see this post by Scott Hanselman for more information.
It may not be ideal, but I was able to hide a folder from the solution explorer in an Asp.net 5 project by marking the folder as hidden in the windows explorer properties dialog. I had the .idea folder used by WebStorm showing up so it being hidden was not too big a deal. WebStorm doesn't mind.
It seems like the folder will not be hidden if it is already in the solution explorer. Mark it and it's contents hidden and move it temporarily out of the project folder. Make sure it disappears from the solution explorer before moving it back. It should not show back up. A restart of Visual Studio may also work, I didn't test that.
Rightly or wrongly, here's what I did to get bower_components and .sass-cache out of the way. In my case, node_modules was already excluded from my project somehow, even though it's at the same level with gruntfile.js. I still don't understand why it is treated differently. Anyone know?
First, I set my location like this in the .bowerrc file:
{
"directory": "../../artifacts/bower_components"
}
Then I adjusted my paths as necessary in my gruntfile.js
Also, To get the sass-cache folder out of the way, since I was using grunt-contrib-compass, I configured my compass task with this option:
cacheDir: '../../artifacts/.sass-cache',
There are other ways to do this if you are using other sass / compass tools.
RESULT:
I can now search my entire project for text and not get hits in my libraries.
bower_components and .sass-cache are out of reach of source control.
With the latest Visual Studio you just need to right-click the folder/file and chose "Hide from Solution Explorer".
That will change the "xproj" this way:
<ItemGroup>
<DnxInvisibleFolder Include="wwwroot\" />
</ItemGroup>
Looking at the state of asp.net 5 with visual studio 2015 I can only say that they made it much more difficult and inconvenient to work with task runners like gulp or grunt. Since I'm using Web API 2 to manage my data I switched to Visual Studio Code with bower, gulp and browsersync and this has proven a to be LOT easier and faster with much less clutter.
To make a startup template: https://github.com/Swiip/generator-gulp-angular
Now you can use any editor and you get a clear separation of front end and back end development. Plus you get to know gulp and bower and the (minimal) command line stuff which VS2015 tries to do for you (and fails to do so many times).
Oh yes: you don't have to exclude folders anymore, since the template has a much more sensible folder structure

How to map and opening ASP.NET solution file in TFS?

What I"m trying to accomplish is to get the latest solution from TFS Team System Foundation, build and debug it. I can map the solution to my local folder but when I try to open it I have an issue where I can't build and debug it. Here are the steps I"m taking:
Open Visual Studio 2010; Open Team Explorer (using TFS2010) window; Open Source Control Explorer window
Navigate to solution directory example: $/WebSites/English/Development/Source/WebApp
Right Click Map to Local folder
Select folder; click yes to get files and wait for file to be moved to local folder
Open Windows Explorer, navigate to folder with sln file
Double Click sln file to open it
• What I would like to occur is to have solution open; build and debug it
• 7. What occurs is another Get Progress that gets all files again and alters the file structure in Windows Explorer
Then when I attempt to run and debug the solution it doesn’t have all the files. For example in the browser when viewing the site a lot is missing, it’s not rendering correctly.
On a co-workers machine it works just fine.
Why doesn’t the sln file open correctly?
How can I open the solution to build and debug it?
Thank you in advance,
Catto
Ill assume you are doing a get latest version before you do this.
here are some things to check.
First expand the references for all the projects in the solution and make sure they are all correct, the icon will be different for anything missing.
Make sure the web settings are correct, they can be saved in the solution file or not, its an option.
Make sure there are no pre or post build events that are screwing things up
make sure someone didn't flat out forget to add the files to TFS or maybe they didn't check things in yet
if all that doesnt help make sure the versions of your referenced dlls are the same as your coworkers ... and the GAC if its being used

Resources