Create TaskPane in Outlook with NetOffice - c#

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

Related

office vsto add in not loading on release

I have an office add-in (vsto) that has been working fine for ages.
It launches perfectly, runs nicely no problem, but this is only when debugging from visual studio.
If I now take the files from my bin\debug and move it to another folder, then I register the released version
c:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\Program Files (x86)\MyPlugin\MyVSTO.dll"
it registers correctly, but will not load in office.
I have tried retricking the registry setting "LoadBehavior" setting it back to 3, but no luck.
office keeps complaining about my add in with the error
"Not loaded. A runtime error occured during loading of a com add in"
So it seems like it is dying when trying to launch. I though there was a missing dll or something, but no such luck, every library i need is in the folder.
This is the exact same machine so shouldnt be a dot net issue
fyi
This is done in C# 4.0 using netOffice
You can not install an Excel add-in using REGASM because it does not setup all required information; you need to deploy your add-in as per MSDN office deployment guidelines, you have two choices:
Click once
Windows installer
Note: VS actually installs the Add-in for you by setting the right information In Excel and the registry, so that you do not need to deploy the add-in manually for every new build.

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")

How to include source instead of a library in C# / Visual Studio?

I come from a long Java background and very new to C#. I was trying to run one of the starter kit applications from Windows phone and I am getting this error.
A first chance exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.WindowsPhone.dll
I am finding it hard to debug this because I am directly referring to the dll file under References pointing to Newtonsoft.Json.WindowsPhone. In Java, I would have searched for the library and downloaded the source to step into the exact location during debugging.
If that is possible, how would I do it in C# (as in how would i refer the library source for my project to pick up at run-time)? I am using the Visual studio 2010 Express Edition as the IDE.
Download the third party library you are dealing with
Add this library's project into your solution
In your project, remove the reference to the 3rd party library
Add a project dependency into your project, make it depend on the 3rd party library project you have just added to your solution
Compile and run, happy debugging
My best guess is you should download last release of Json.NET, remove the compiled library from your project's references and add reference to the source code project. (Add Reference... > Projects > Browse...)
Once you have stopped your program in the debugger, you can use the modules window to load the symbols for Json.NET. Obviously, you need to have the symbols on your machine so you can browse to them.
Failing that, you can switch to a project reference and include Json.NET in your solution as Dan suggested.
The easiest way is to download their latest build then inside visual studio right click your solution and under add menu select existing project point to project file of the library and click open button. after that u will be able to set brakepoint wherever u want.

Unable to Debug my Add-in solultion

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.

Categories

Resources