Class Library project in Visual Studio 2015 - c#

I used the Class Library project rather frequently whilst using VS 2013. I am now on VS 2015 (yep, slow to migrate) and I don't see a Class Library project available. Has its moniker changed? Is there an equivalent project type?
Can I just add a class instead now?

Quite a few options here:
1) Use class library project from Windows subsection:
2) Search for a template online. There is a link that reads: Click here to go online and find templates (at the bottom of the dialog shown in the printscreen).
There you can search for a class library in the Web section:
3) Modify VS installation and check Microsoft Web Developer Tool. More details here.
4) Try reinstalling ASP.NET templates.

Related

How can I find out what type of c# project I'm using in Visual Studio 2017?

I don't know a lot about c# or Visual Studio and I am working on a c# project, but I don't know the details of it. For example if it's a Desktop project, an Asp.net project, a .Net framework project, or what libraries it has access to.
How can I find this out?
If you right click the project and go to properties it will provide you with the information that you're looking for.

Is it possible for me to create a Windows Service in Visual Studio Web 2013?

I don't know why Visual Studio is such that there are a million different versions (Visual Studio for Desktop, Visual Studio for Web, Visual Studio Code, etc.) and each version has a different set of project templates. Anyhow, the problem I'm having is that I'm creating an ASP.NET MVC application through Visual Studio Web 2013 and I want it to be supported by a Windows Service that is started in my App_Start(). The problem of course is that when I read the instructions on https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx there is no Windows Service template on Visual C# when I try to add a new project to my solution.
I understand your web endpoint will be dependent on a Windows Servie, and you want to author that windows service as part of your solution.
Setting aside that VS.net 2015 Community Edition rolls up all the functionality you need. You dont need the project template specifically to create a windows service. It just automatically adds some references and templates into your project. All project templates in VS .net rely on the .net framework - and that isn't any different between one installation and another of VS.net.
In practise you can code a windows service written for .net in Notepad and just call the CSC compiler manually - the version of VS.net just adds some ease-of-use.
There is a set of instructions here https://msdn.microsoft.com/en-us/library/9k985bc9(v=vs.110).aspx from Microsoft which include specific instructions on how to make a windows service without a template.

run downloaded mvc C# blog template on visual studio 2013

I have no idea of C#. I downloaded mvc blog with following files:
i have visual studio 2013. i want to know how can i run the website.
error shown:
A Project with an output type of class library can not be started directly
There are multiple projects in given solution & the selected project is class library which obviously can't be started with run button.
Open solution in visual studio, right click on website/webapplication with MVC NBlog.Web , select option Set as StartUp Project & then run application.

Why in visual studio 2013 express, I don't have a project template Windows Control Library?

If it's not exist in the express version, is there any other way to make Windows Control Library ?
This is what I see when trying to make a new project:
If you mean as in a COM .ocx file, that's not how .net works. You might even have to get Visual Studio 6 installed to do that, although I suppose check out the other project types. It's also possible there are other project types that are not installed by default, so try re-running the VS installer and see what else is available.
For a .net controls library you should create a class library and add your forms to it. VS will add the necessary references for you, and you can then reference that assembly from any other managed code.
In Visual C# Express Edition, according to this :
Windows Control Library: Missing Windows Control Library Template
Windows Control Library Template should be same as : Class Library project template
But with added reference to System.Windows.Forms.dll.
I found another trick to create this missing template for visual studio 2013 Express, With the help from this link:
http://www.dotnetspider.com/resources/21844-How-add-windows-control-library-template.aspx
So the steps for C# express 2013 are nearly the same than in the example witch is about c# 2005
Open Visual C# Express 2013.
Create New windows Application with the name: MyLibrary
From the Project menu select Add User Control. Click on Add
Close any forms windows.
(a view with the Form already closed)
In Solution Explorer, Delete forms related files
(the corresponding .cs files should be deleted by this step)
From the Project menu select MyLibrary Properties.
In the Application tab set the Output Type to Class Library.
In the file Program.cs replace
Application.Run(Form1)
with
Application.Run()
Build the Solution. There should be no errors and the bin/Release folder should have a MyLibrary.dll file (i found it in Debug in my case)
From the File menu select Export Template.
Select Project Template then Next .
Under Template Options change the name of the template to Windows Control Library and the Description to Create windows Control .dll. Click on Finish.
Close C# Express 2013.
The next time you open Visual C# Express, you will find your newly created template ready to use.

StandAlone c# application [duplicate]

I've finished my C# application, but I have a little problem:
When I try to run my application in another PC, I need always to Install .NET Framework 4.0.
Is there something to do to make it work without installing the framework from internet?
I tried before InnoSetup for a VB6 application, but I'm not sure if it's going to work for .NET 4.0!
Any ideas?
Use Visual Studio Setup project. Setup project can automatically include .NET framework setup in your installation package:
Here is my step-by-step for windows forms application:
Create setup project. You can use Setup Wizard.
Select project type.
Select output.
Hit Finish.
Open setup project properties.
Chose to include .NET framework.
Build setup project
Check output
Note: The Visual Studio Installer projects are no longer pre-packed with Visual Studio. However, in Visual Studio 2013 you can download them by using:
Tools > Extensions and Updates > Online (search) > Visual Studio Installer Projects
You need to create installer, which will check if user has required .NET Framework 4.0. You can use WiX to create installer. It's very powerfull and customizable. Also you can use ClickOnce to create installer - it's very simple to use. It will allow you with one click add requirement to install .NET Framework 4.0.
WiX is the way to go for new installers. If WiX alone is too complicated or not flexible enough on the GUI side consider using SharpSetup - it allows you to create installer GUI in WinForms of WPF and has other nice features like translations, autoupdater, built-in prerequisites, improved autocompletion in VS and more.
(Disclaimer: I am the author of SharpSetup.)
Include an Setup Project (New Project > Other Project Types > Setup and Deployment > Visual Studio Installer) in your solution. It has options to include the framework installer. Check out this Deployment Guide MSDN post.

Categories