First steps with plugin

Hi everybody,

I’m not use to write in C#, I never used Visual Studio.

But since few weeks I try to get in vvvv plugins as it’s seems to open so many possibilities.

I succeed to create some plugins by using vvvv templates, but as I’m now making some more “complexe” code(from my point of view :), I would like to be able to debug it step by step.

So I installed visual studio 2005 and I followed this tutorial from Vux without success:
debug vvvv plugins using visual studio 2005

Here is what I did :

  • I made a simple plugin from vvvv value template.
  • Save this plugin in vvvv folder : …\vvvv_45beta27.1\plugins\ValueTest
  • Open “ValueTestNode.cs” with visual studio 2005 and put some break points in the code
  • As I was not able to see “build” menu in, I create a new empty project in visual studio
  • Then I followed carrefully all steps of vux turorial (except the "Utils and PluginInterfaces references “copy local” properties to “false” - I didn’t found thoses parameters)
  • Then in this step : “If you add your plug-in within the vvvv patch, you should be able to follow step by step what it does now :)”

I didn’t manage to see my program step by step, in visual studio the breakpoint of “ValueTestNode.cs” display “The breakpoint will not currently by hit, no symbols have been loaded for this document”…

It must comme from something I misenderstood, so I would really apreciate your help before throwing my computer screen thru the windows :)

Visual studio 2005 is a bad option. Just use SharDevelop or VisualStudio 2010 Express, both are free. To create a project, just clone one of templates in VVVV and after this close VVVV and open project file in SharpDevelop 4.2 or Visual Studio 2010.

Thanks for your quick reply,

With VS 2010 Express (Visual C# 2010 Express) :

  • I opened the project
  • Then I couldn’t start debuging (the command was grey) and I had 13 error and 5 warning in the error windows.
  • By by specifying the “reference path” (vvvv_45beta27.1/lib/core) in the project property this problem disapear.
  • And now have this message : A project with an Output Type of Class Library cannot be started directly

But I didn’t manage to solve it…

With SharpDevelop :

  • I also had the problem with path reference but even if I specifiy the correct path in the project property I did’nt succeed to make this problem disapear…

PS: Thank to Vux who tryed to help me on skype

ok, let’s try based on an example. say we want to debug the Template (Value) node, located in lib/nodes/plugins/Template.

  • startup vvvv, create a Template (Value) node and connect its output to an iobox, so it will be evaluated every frame.
  • open the project explorer (ctrl+j), and change from release to debug build in the dropdown box located in the top right corner. if you look to the lib/nodes/plugins/Template/bin/Dynamic folder you should see a *.pdb file. this file is mandatory in order to get debugging to work.
  • open lib/nodes/Template/Template.csproj with sharp develop
  • go to the Evaluate method of our Template (Value) node and set a breakpoint there (keyboard shortcut is F7). in my case it was line 37 of the Template.cs file.
  • in the menu of sharp develop select Debug->Attach to Process … and select vvvv.exe
  • execution of vvvv should stop immediately and you should be able to step line by line through your code.

with beta 27 we changed our folder structure and moved to .net 4, as it seems we missed to update those template project files, therefor it’s a little hard to get them compiled in an external ide. sorry for that.

but if you think about serious plugin development i’d recommend downloading our vvvv sdk, as it is setup in a way that you don’t need to worry about paths and assembly references anymore. it should simply compile out of the box and you can look into the source code of all plugin related stuff.

Once again Elias : Thank you very much !

That was a really precise step by step tutorial. I just try once and it’s works.

For now, I just want make some little plugins because sometime I feel the need to make some really precise function for my projects, which are quite complicated to make with vvvv node but really easy with 3 lines of code.

But as I’m interested in automation, my final aim is to make v4 able to comunicate with component thru CanOpen, ModBus, RS485, or other protocol. Then v4 will make the link between all my hobbies! So thanks for vvvv sdk link.

Hi Elias, I’ve just followed your instructions using Sharpdevelop but vvvv execution doesn’t stop when I ‘attach to process’.

I’m guessing it’s because ‘if you look to the lib/nodes/plugins/Template/bin/Dynamic folder you should see a *.pdb file.’ is not true in my case. There is no pdb file there. Why might that be?

EDIT > switching between release and debug mode a few times fixed it