Code to generate templates - visual-studio-code

I just downloaded Visual Studio Code last night. What do I do so that Code will generate, say, a Console Application template?
I've read around the web so far I can't find anything telling me how to create a template.

Q: How do I create and run a new project?
A: VS Code doesn't include a traditional File > New Project dialog or
pre-installed project templates. You'll need to add additional
components and scaffolders depending on your development interests.
With scaffolding tools like Yeoman and the multitude of modules
available through the NPM package manager, you're sure to find
appropriate templates and tools to create your projects.
for details: https://code.visualstudio.com/docs/setup/setup-overview
and a question on SO: Run C# Console Application on Visual Studio Code Editor on Windows

Related

How to run NUnit tests from inside Visual Studio?

I have downloaded the source for NHiberate 4.0.4 and want to run some of the unit tests. Not sure how to go about doing this. I played around with NUnit several years ago and seem to remember there was a addin for visual studio but couldn't find it. Is there a way to run the NUnit tests from within Visual Studio, similar to the way JUnit works in eclipse?
It's an old question but still deserves a step-by-step, how-to answer with reference to the latest versions of VS (2019) and NUnit (4.0) since NUnit tests won't run in VS 2019 out-of-the-box.
Here's how to set it up:
Install the NUnit 3 Test Adapter extension to VS by selecting Extensions > Manage Extensions from the main menu. Restart VS to complete the installation.
Add a Class Library project to your solution. Right click on the project and select Manage NuGet Packages menu option. Browse for NUnit and install it.
Add a public, non-static class to the project to host your tests. Mark the class with the [TestFixture] attribute. Also, don't forget to add the required using NUnit.Framework directive.
Add a public method to the class and mark it with the [Test] attribute. Repeat with as many methods as necessary.
Build the project and then select Test > Run All Tests from VS main menu. The Test Explorer will pop up and show you the progress and outcomes.
If you are using Visual Studio 2012 or higher, then yes, you can run NUnit tests directly from Visual Studio. I think NUnit Test Adapter
may be what you need. For VS 2013 and higher this may not be necessary - if NUnit Framework is installed and the project references it, anything declared as [TestFixture]/[Test] has a Click to Run icon on the left.
Hope this helps!

How can I deploy a Durandal application using visual studio 2015?

I have a Durandal application created in Visual Studio 2015, using mvc and ef6. When I deploy the project to the web, Visual Studio takes care of the bundling of the various js and css files, but not of those that Durandal is using, nor the view and viewmodel files I created in the app.
In the Durandal site there's a short explanation on how to do this; however, it is very minimal, and I cannot find a way to create the 'main-built.js' file described there. I followed the instructions of installing gulp and adding 'gulp build' command to the Build Events, but when I try to build the project it seems that 'gulp' cannot be found.
Can someone please provide a more detailed explanation on how to deploy a Durandal application using Visual Studio 2015?
1- Make sure that "nodejs" has been installed on your system.
2- Create a new empty web project in your vs2015.
3- Add "HotTowel: ASP.NET MVC SPA Template" with nuget package manager.
If you use "durandal 1.x" run optimizer from : "~\App\durandal\amd\" folder. (run it from a separate command prompt window is better solution)
If you use "durandal 2.x" follow this steps:
1- Install Gulp or Grunt via Nuget Package Manager.
2- Add a config file in the project root to create your "built config file" (Gulp or Grunt ...)
3- For automating builds with vs, follow this
If there is no error in the application ('javascript code'), even a bit !, it runs correctly.

How to import a Makefile-based project filesystem to Eclipse based ARM DS-5 Workbench?

We have an ARM project comprised of dozens of C source and header files, built from CLI using a Makefile hierarchy (specific build options are given as make command line params). The dev environment is the ARM DS-5 toolset. I want to use the existing Eclipse based Workbench IDE to continue the development of the project.
By defining a new Workspace and creating a new C project in it, I can import the whole filesystem to the project to browse and edit the files. However, the IDE is not "aware" of the project structure.
Is there a way to automatically generate an IDE project based on the project's Makefile(s)?
Note that there are a few similar questions around here, but I could not find a discussion specific to DS-5, and it looks like some options from CDT are not available in DS-5.

How can I create a solution level NuGet package for an entire project?

I have created a NuGet gallery in my company.
I want to create and publish a solution level NuGet package.
Everyone who will install the package will not get a dll but an entire project added to his/her visual studio solution.
Just like adding an existing project, the user will get a project with source code classes and everything is ready to use.
Just build it and use it.
I know it's possible, but couldn't find any documentation.
Anyone?
It is possible to add any files (not only .dll) and even directory structures to a NuGet package, so in theory you could store all files belonging to a project in a package and publish that. However, it is only possible to install NuGet packages into an existing project, meaning that you won't be able to add the packaged files as new project to any solution. In addition, the contained files will be put to the solution's packages folder, not to a solution or project folder.
As an alternative, consider creating a Template project instead of a NuGet package, as explained in How to: Create Project Templates and my blog post Creating template projects. This will result in a .vsix file that any developer can install as Visual Studio Add-In, the templated project will then appear in Visual Studio's File -> New -> Project... dialog as new project type and can be added to any solution.
Similar to your NuGet gallery, it is also possible to create a private Visual Studio Gallery to share such Add-Ins within, for example, a company, as explained in this MSDN article.

GWT Post build command in Eclipse

I am starting getting used to Eclipse, but I have much more experience with Visual Studio. In Visual Studio it is possible to run auto commands after the build has finished.
Now I am creating a GWT project and several other projects at once in one solution (or workspace) in Eclipse. Some files which are compiled with the GWT project needs to be copied to another location when they have been compiled. I am currently doing this manually and would like to do it automatically. I am not doing it often, since the project works fine in debug mode (...?gwt.codesvr=localhost:9997).
But where is the location for executing a post build command for a GWT project in eclipse? Is it possible?
Just open project properties, choose 'Builders' item and click on 'New...' button.
Good question! I'm using Eclipse since about 2003, and I remember that I also wanted a functionality like that back then. However, I got so used to using ant for any serious build, that I completely forgot about it.
There is some useful ant integration in Eclipse (e.g. the ant view), and if you create your GWT project with webAppCreator you already get a few good ant targets you can build upon.
It would still be nice sometimes to have something more GUI-like to do simple multi-step builds with Eclipse. I haven't found anything like that yet, but it's absolutely possible that it exists, especially as a plugin.