run downloaded mvc C# blog template on visual studio 2013 - c#

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.

Related

how to create .exe file in visual studio 2017 for 1 project of selenium using c# having multiple class within it

I am working on a project where I am writing selenium script. I'm writing it in visual studio 2017.I am using c#, NUNIT framework with selenium. I am having several classes. Each class is testing functionality of each pageenter image description here.1 class i.e Login class is kept as parent class and other classes are inheriting that to login to the web page. I want to run the test outside visual studio from command prompt by creating a .exe file for each class. In 1 single project I kept all the class files.how to create .exe file in visual studio 2017 for 1 project of selenium using c# having multiple class within it.
Select Release from the Solution Configuration drop-down list, which is on the Standard toolbar.
On the Build menu, click Build.

Class Library project in Visual Studio 2015

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.

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.

Visual studio doesn't support specific csproj file

I am getting this error when I try to open the solution file of my project. The solution is 2012 file (checked using notepad).
If I click on Ok, The solution opens up except for one csproject which does not load.
I get a migration report in UpgradeLog.htm file, with the following error for the project which failed to load. Could not figure out much from it.
Error:
The application which this project type is based on was not found.
Please try this link for further information:
http://go.microsoft.com/fwlink/?prd=12395&pver=11&sbp=ProjectTypeDeprecated&plcid=0x409&clcid=0x409&ar=MSDN&sar=ProjectCompatibility&o1=82b43b9b-a64c-4715-b499-d71e9ca2bd60
Does the upgrade report mean that it is a project from previous version of Visual studio? It does not open in Visual Studio 2010 either.
The error doesn't say that Visual Studio doesn't support .csproj files at all, it says it doesn't support a specific project type in that particular project file. This means this either isn't your project as you claim, or you are trying to build it on a different machine from the one used to create the project.
Visual Studio uses various elements in a .csproj file to determine its project type. See How do you tell the Visual Studio project type from an existing Visual Studio project and What is the significance of ProjectTypeGuids tag in the visual studio project file. It does this so it knows how to compile your project, what properties tabs to show, what context menu options should be available and so on.
Certain project types can cause this error. Usually they require some kind of SDK to be installed on the machine used to open or build the project.
You should search the web for the GUID mentioned in the error message you show (the value after o1=). You can also open the project file in a text editor and find the <ProjectTypeGuids> elements, which contains comma-separated project type GUIDs.
Then search the web for those GUIDs to find out which SDK or tool you need to install in order to be able to open or build the project.
If you paste the specific GUID from your error message in your favorite web search engine, you'll find Problem solved: Visual Studio / There is a missing project subtype. Subtype: '{82b43b9b-a64c-4715-b499-d71e9ca2bd60}' is unsupported by this installation., where it is mentioned you'll need to install the Visual Studio 2013 SDK. This means that in this case, your project is a Visual Studio 2013 extension.
This is what documentation is for. You should at least put a ReadMe.txt file in your project directory, explaining what the prerequisites for building a project are, especially when it won't open or build with Visual Studio out of the box.
I had this issue when I used Update 5 for VS 2013.
For me I had to click ok and read the next few steps, that popped up. I was initially clicking cancel.
On mine the project was missing Web Tools, so had to reinstall those and once done it was working.
Hope that helps someone.
This issue also appears when trying to import an ASP.Net project into Visual Studio 2015 Express for Desktop, and can be solved by simply downloading and installing Express 2015 for Web - or by using Visual Studio Community/Standard.
I am currently using VS 2017 v 15.7.4. This error came out of no where without any updates on my part. Usually when I have errors like this I just delete the .vs folder in my solution and that clears the problem. In this case that is what I did and the problem was fixed.
Close VS
Delete .vs folder
Load VS
Note: This was for a Xamarin based solution.
I solved this problem by downloading and installing (Microsoft Visual Studio Installer Projects). Close the project then install. After the installation, open your project then reload .csproj file
I had the same issue with VS 2017.
Eventually i solved it by just enable the SSIS in the following way:
1. In VS 2017 - Click on Extensions and Updates in the Tools menu.
Locate the Microsoft Integration Services Projects.
if you can't find it then you will have to install it first.
Click on the Enable button.
Close VS and start it again and SSIS projects are now available.
enter image description here
This (the error that states "Visual studio doesn't support specific csproj file") also occurs when the .vs folder is removed; however, closing and reopening Visual Studio will resolve the error.

Post Publish Events

For normal (say Windows Forms) C# applications, to execute commands after a successful build I would use the Build Events->Post-build event command line in Project Properties.
I have a Web Site project which I "Publish", using the "Publish..." command in the context menu in the solution explorer.
Is there a way to run commands after the successful publish and if so how is it done? (eg a Post-Publish event command line field)
Visual Studio 2008, ASP .Net Web site project, C#.
Update: Since Publish Web does not apply to folder-based web site projects, this answer assumes you are asking about a Web Application project.
You can't do this from inside the VS IDE. However, you can edit your project file in Notepad or your favorite XML editor and add a new target at the end of the file called AfterPublish.
You might want to read a bit more on MSBuild if you are not sure what you can do in this target.
You can find more details on extending the build process in VS at MSDN - HowTo: Extend the Visual Studio Build Process.

Categories