Unable to Debug my Add-in solultion - c#

I am working with Add-ins for the past 10 months. I have not faced problem like this before. When I try to debug my Addin Solution in Visual Studio 2008, I get the following error.
Could anyone please help?
A project with Output Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution
which references the library project. Set the executable project as the
startup project.

The error makes sense, you need a hosting process for you addin, e.g. Visual Studio. I usually follow this workflow when debugging my VS addins:
Build your addin library in VisualStudio instance A.
Start VisualStudio instance B.
Load the Addin in VS instance B
In VS instance A, go to Debug | Attach to Process. Select the VS instance B process and attach your debugger.
Once you've done this you can set breakpoints etc just like any other process.

Related

Attached Debugger to all open visual studio instances

How can I programmatically open multiple solutions in Visual Studio and start debugging them simultaneously?
You can achieve this function by calling dll. For example, I have a Project a in Solution a and a Project b in Solution b. At this time, I need to copy the Project b.dll and Project b.pdb to the Solution a\Project a\bin\Debug directory, and then call it. Please refer to the details. Debugging multiple solutions in Visual Studio

Create TaskPane in Outlook with NetOffice

First things, I am a beginner in developing Add-Ins and I didn't find a good documentation for using NetOffice.
I have created an automation Addin project with the NetOffice Developer Toolbox. I want to create a TaskPane. When I start the project it throws the following exception:
A project with an Output Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project.
May someone can tell me what is necessary to start the TaskPane.
This is my Solution
I appreciate any help.
To debug the NetOffice addin project, you must change the Debug properties of the project in Visual Studio - set the Start external program to point to your installed MS Outlook EXE file.
If the add-in is correctly registered, you can debug the Task Pane.
More info: https://stackoverflow.com/a/3363236

Visual Studio: "Project with an output type class library cannot be started directly"

I checked out a solution consisting of two Visual Studio 2012 projects from a TFS repository. The first is a Visual Studio Add-In, the other project is a WPF User Control Library. As the library cannot be started directly, I selected the AddIn as the StartUp project. Nevertheless, I can't run it as it always reports
Project with an output type class library cannot be started directly.
I get this error if I try to run the UserControl library alone, which is totally legit. But I definitely get the same error trying to start the AddIn. I have a project with exactly the same setup, which just works fine. My colleague does not have this problems to, working with the same TFS checkout.
There exist several threads concerning this question (like "A project with an Output type of Class Library cannot be started directly") but I didn't find an answer there.
Any suggestions or ideas? Thank you!
Add-ins can't be started directly either. You've set the add-in as the startup project on the solution. Now you need to go into the properties of the add-in project. Output type should be dll. Start action should be "start external program"
In the box, supply the path to VS, for me it's...
C:\Program Files (x86)\Common7\IDE\devenv.exe
Then command line arguments should be...
/resetaddin <YourAddInName>.Connect

How to debug VS add-in?

I am trying to modify a VS add-in, this addin has multiple projects. The addin project itself, some class librarys that it uses an an user interface project.
When I try to debug I get the error "A project with the output type of class library cannot be started directly." Since all projects essentially have the same output type, I am not sure what to do. I tried making sure the startup project is the actual vs addin project, and I still get the same errors. I have never worked with an add-in before so I figure I am probably missing an important step here. I am using vs 2010, and the addin targets that aswell.
Any help would be appreciated.
Did you try to specify Start external program property of Debug section of the project properties? Try to set a full path to Visual Studio exe (something like "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe")

Mixed project solutions in VS2010- managed and native

I've been writing a program that serves in two primary parts- managed UI and native back-end (C# and C++). However, suddenly, Visual Studio thinks that when I try to run the solution, I'm tryng to run the native back-end (a DLL) and throws an error. When I start the exe manually, it won't break on my breakpoints, and suchlike - even though I've enabled mixed debugging. How can I set it back to the original settings- mixed mode debugging and start the managed .exe when launching? I'm in Visual Studio 2010.
I think that this is probably caused because I had a blue-screen in the middle yesterday, and this is the first serious work I've done on it since.
It sounds like you just need to set the managed project as the startup project in Visual Studio.
Open Solution Explorer
Right click on the project and select "Startup Project"

Categories

Resources