Plugin Development with Visual Studio 2015 and Dependencies

Hi,

Countless times already I tried in several occasions to get Visual Studio working for Plugin Development, but always gave up after one or two days. So this is another of such attempts…

The documentation is very sparse here.

But I read that theoretically you should be able to clone a plugin template in vvvv and open the .csproj file in visual studio 2015.

Some people talk about you have to set up an environment variable, but its no where described how.

Can someone point me in the right direction please?

So far I get only an error after running about missing output path and assembly name…

A step by step guide would be good!

Hi,

i made a ready to go template repo quite a while ago but it should still do the thing.
its basically a vvvv-plugin template repo which you clone if you want to start a new plugin.
you just then have to rename the files.
To download the basic vvvv dependencies it uses the packet package manager - the bootstrapped executable is also included in the repository - you call it with .paket\paket.bootstrapper.exe then .paket\paket.exe init and finally.paket\paket.exe install

there is also a manual build script included but better use vs to build.

i also made a powershell function which does all that automatically. which you can include in your ps config
afterwards your able to clone new template just by “create-vvvv-template name”

    #create vvvv plugin template in current directory
    function create-vvvv-template ($name) {
        if($name -eq $Null) {
            Write-Output "you must specify a name!"
        }
        else {
            Write-Output "Clone Repo - should be changed to donwload a zip"
            git clone https://bitbucket.org/ingolfheinsch/vvvv-plugin-template.git

            Write-Output "rename folder"
            Rename-Item .\vvvv-plugin-template -NewName $name

            Write-Output "rename solution & csproj"
            $sln = ".sln"
            $csproj = ".csproj"
            $cs = ".cs"
            $soultion = $name+$sln
            $project = $name+$csproj 
            $class = $name+$cs
            Rename-Item .\$name\vvvv-plugin-template.sln -NewName $soultion
            Rename-Item .\$name\vvvv-plugin-template.csproj -NewName $project
          #  Rename-Item .\$name\Class1.cs -NewName $class
            Set-Location .\$name

            Write-Output "install latest paket"
            .paket\paket.bootstrapper.exe

            Write-Output "run paket install"
            .paket\paket.exe init
            .paket\paket.exe install

            #update build batch
            Write-Output "update build batch"
            (Get-Content .\build.bat).replace('vvvv-plugin-template.csproj', $project) | Set-Content .\build.bat
           }

}

hope that helps.

aaaand the link to repo

@milo

That is pretty awesome, thank you. I managed to build a node with visual studio, yey!

Now I have the question whats the best praxis to rebuild the project and to see immidiate changes in vvvv?
because in the moment i have to close and reopen vvvv to rebuild. also if i set it to debug and attach it as the active process in the debug menu of visual studio, it prompts to leave debugging for the build and then build fails because “process in use”.

Regarding your script, which would be also realy cool to get running:
I found its missing a bracket in the end, then i was able to run it, but it doesnt do anything, also when specifying the folder parameter. But maybe I didn`t get your last sentence right about including to the powershell config. Where can I edit the ps config actually? Also cant find it in the web this answer…

tekcor

thats the only way. pity

Hi,

for coding without interrupts you better go for Dynamic Plugins or even better: VL
The only way to semi-automate build and run procedure in VS is to use custom post build action in VS or as is did use external build script which build the dll, shutdown v4, copy the dll, restart vvvv. thats cumbersome in any way. debugging plugins with VS is only possible if you build and run them beside the whole vvvv sdk which is another story - but at least you wouldn’t need to shutdown v4 manually every time…

regarding the script. actually it isn’t one. its just a function which you can paste into your personal psconfig.

ps. brackets got lost during copy & pasting

I’m nit sure if you seen that https://vvvv.org/documentation/debug-vvvv-plugins-using-visual-studio-2005

you can actually just use vs as ide and debugger, still having vvvv compiling the dynamic plugin and recompile via resetting the node a la alt right click.

for simpler stuff my workflow is creating a dynamic plugin in vvvv as always. not opening the built in editor, but just open the generated csproj via visual studio. do my coding there. everytime i need a rebuild, just save in visual studio, reset the dynamic plugin.

6 Likes

Thanks everyone! Now I am ready to go :)

i just tried this and VS is showing a couple of errors due to missing dependencies. you are working like this with VS ?
test

woei seems to take a hybrid approach, telling from his github repos.

the vvvv dlls are sometimes pulled from nuget and referenced from /packages
but usually his stuff is dependent on a certain directory configuration, so the plugin finds the dlls relative to his working directories, like here

so yes, I was wrong, you can actually do plugin dev in vs without constantly restarting vvvv, but it comes at the price of some unfortunate csproj classpath hacking.(or reverse engineering and mimicking the original directory structure of the author)

@u7angel
2 things to note:

  • once you move the plugin, you have to adjust the ReferencePath in the csproj accordingly to have vs pick up the vvvv core dependencies again
  • the template defaults to x86, so you have to delete the ‘x86’ in the first project group in order to have vs not thinking there’s a mismatch
3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.