Use Visual Studio 2013 for web without .net - visual-studio

Isn't it possible to use Visual Studio for web development without attaching any .net? Even if you select an empty project, it ties in .net file associations.

I have done it the following way:
Under C++ (yes, I know you are not going to develop in C++) create Makefile project.
Blank out everything in the dialog that it is going to do. So it is all empty
Rename "Header Files" "Resource Files" and "Source Files" to something appropriate like HTML files, Cascading Style Sheets and JavaScript Files
In the properties of each, change HTML files to show html (not .html), Cascading Style Sheets to css and JavaScript Files to js.
When you create new files just use Add->New Item at the project and under Visual C++ it has Web where you can pick .html and .css (but not .js so for that use Code and just use a .js extension).
Note: you can add .php etc if you want.

Related

Hiding generated js files in Visual Studio 2017

How would I be able to hide generated js files (Transpiled from Ts files) in the solution explorer?
Lets say I have an angular website. I add this angular project to Visual Studio (Chose Visual Studio 2017 Enterprise as my code editor). There seem to be no straight forward way to hide these generated js files. The solution suggested by Hiding js files in visual studio looks very crude.
I am more into a solution similar to what has been suggested in
Hide .js.map files in Visual Studio Code but it appears to be only applicable to VS code. How can I achieves this in Visual Studio? Where can I see the work space related settings for an existing web-site (angular project) added in visual Studio?
Even through it is not exact answer to your question, I will recommend to not hide js files in particular editor, but organize project in the way, that compiled code located separate from source files. It is common to have src and dist folders inside your project. You can use outDir setting in tsconfig.json in order to achieve this.

VS2013 not adding Javascript generated from Typescript to project automatically

I'm using TypeScript for the first time. I'm using Visual Studio 2013 with update 4, Web Essentials with update 4, and have the latest version of TypeScript from Microsoft's website. However, following the tutorial doesn't work for me: when saving a TS file, it automatically compiles to JavaScript on the screen to the right of the code I typed, and a JS file is created in the folder. However, this file is not added to the project automatically. How can I set Visual Studio 2013 to automatically add generated JS files to the project?
How can I set Visual Studio 2013 to automatically add generated JS files to the project
Use a glob for your TypeScript folder i.e. modify your .csproj file to include:
<Content Include="client-src\**\*.*">
</Content>
Besides Basarat's answer which works, there's also another solution: not doing anything. TypeScript generates a JavaScript file, which automatically gets placed in the same folder as the TypeScript file. When in Visual Studio, right click the folder your TypeScript file is in, and select "open folder in file explorer". You should see that the folder holds both the TS file you made, and the JS file that got generated.
You do not need to add this JS file to your project folder inside Visual Studio: you can just reference it. If you have an MVC project with a Scripts folder that has a file called greeting.ts (the one you make in the TypeScript tutorial), the path would be "~/Scripts/greeting.ts". Instead, just use "~/Scripts/greeting.js" (ending with js instead of ts). Visual Studio is smart enough to figure it out from there. This works with bundles as well.

Adding typescript file to PTVS project

Typescript seems to be great alternative to javascript.
we are using paython for visual studio aka PTVS.
the problem there is no wat to add .ts file to the project
any idea?
This is a general problem with VS projects, in that they themselves decide the "suitable" item types for Add New Item dialog. However, you can always add, say, a .txt file, and then rename it to .ts.

creating custom templates in visual studio & resharper

I would like to create custom templates for c# files, unit test classes, .aspx.cs etc so that common items to all files are included once they are created eg file headers. I am working with visual studio 2010 and resharper 6. What is the easiest way to create these files and is it possible to be able to share them a team of developers easily? Appreciate any assistance or information as to how I might achieve this.
Visual Studio templates are simple enough to create - you can distribute them to your colleagues to setup in the same location on their computers (or even create an installer, if you want to makes things even easier).
See Creating Project and Item Templates and the Introduction to Visual Studio Templates on MSDN.
Contents of a Template
All project and item templates, whether installed together with Visual Studio or created by you, function by using the same principles and have similar contents. All templates contain the following items:
The files to be created when the template is used. This includes source code files, embedded resources, project files, and so on.
One .vstemplate file. This file contains the metadata that provides Visual Studio the information it needs to display the template in the New Project and Add New Item dialog boxes and create a project or item from the template. For more information about .vstemplate files, see Visual Studio Template Metadata Files.
When these files are compressed into a .zip file and put in the correct folder, Visual Studio automatically displays them in the My Templates section of the New Project and Add New Item dialog boxes. For more information about template folders, see How to: Locate and Organize Project and Item Templates.
You should open Templates Explorer from ReSharper | Templates Explorer. Then select the File Templates tab. There are default templates that comes with ReSharper. You can examine them and see how you can write your own. Here's the documentation and there's a question for useful examples.

How do I edit default Razor Creat/Edit scaffolding in Visual Studio 2010

is there a way I can hack out the fieldset and legend tags in the VS2010 MVC razor view templates?
I've had a bit of a look through the C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE directory but I can't find what I'm looking for.
If it is specific to your project, what you can do is copy the default templates to 
your project and modify them.
The MVC razor view templates are located in:
<Visual Studio Installation Path>\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates
\AddView\CSHTML\
Copy the .tt files
Create a matching folder tree in your project starting from CodeTemplates. In this case, 
you need to create \CodeTemplates\AddView\CSHTML\ and paste the .tt files there.
Now you can edit the .tt files as you want. When you crete a new view in that project, those templates will 
be used instead of the default ones from the installation folder.
That also works for the controller templates, you just have to make sure that the folder 
tree matches.
Sounds like you'll need to download the source for MVC 3.0 and copy the templates you want to overwrite into you project and make the changes there.

Resources