I'm building a winforms plug-in project with visual Studio 2013 Express. It will be a 'toolbox' where various 'tools' can be added by copying their DLLs to some folder from where they can be seen, loaded and added on a new tabpage. I have decided to run one VS copy for the plug-in frame and one to create the plug-ins.
I have found this thread on how to create DLLs from a studio project and for the first test everything went fine. Nice workflow. But when I changed the first tool to descend not directly form UserControl but from a custom plug-in base class which inherits from UserControl I got a compiler error. (type or namespace 'Base' not found...)
Here is a totally stripped-down version, which will get the same error. Obviously there is something wrong or missing in the edited .csproj file.
- So, how should the build file be changed to allow creating DLLs for inherited classes?
- Also: Is there an explanation of the options, like "Plugin" or "DependentUpon" or "SubType" ?
BTW: In the real version I had to merge the partial class parts of the UserControl to make it work. (That was before moving to the base class.) Can I change the .csproj file to allow partial classes?
using System; //.. namespace test_cx1 { class Base { } }
using System; //.. namespace test_cx1 { class Tool1 : Base { } } <ItemGroup> <Compile Include="Base.cs"> <Plugin>true</Plugin> </Compile> <Compile Include="Tool1.cs"> <Plugin>true</Plugin> <!-- does not compile --> </Compile> .. .. <Target Name="BuildPlugins"> <CSC Condition="%(Compile.Plugin) == 'true'" Sources="%(Compile.FullPath)" TargetType="library" OutputAssembly="$(OutputPath)%(Compile.FileName).dll" EmitDebugInformation="true" /> </Target> <Target Name="AfterBuild" DependsOnTargets="BuildPlugins"> </Target>