I have a c# application that does all kinds of automation stuff based on voice commands.
I want other users to be able to develop plugins that can add additional functionality.
If the users create a new project for a plugin, is there a way to have it reference all the dlls that the main application references?
Related
I'm very new to C# and .NET and am looking to improve my departments efficiency with installing multiple common programs for our customers.
For now I used a program called Silent Install Builder to add each exe we install and created a checkbox list they can choose which one to install. It fires off the exe that is packaged into the master exe.
I'm looking at creating this in house now either using WPF or WinForms. Looking for a little push into the right direction on what would be the best route for this for a newbie programmer.
Is it possible to create an VSTO add in for multible office applications?
Can I outsource the functions i want to have for every application and then create an Add-in for every application? If yes, is there a better way to achieve this?
I recommend making a solution with an add-in project for each Office application.
Then add a class library project to the solution and reference that from each of the add-on projects.
That way you can centralize code used in all add-ins.
If you need to interact with the active application or document, you can detect the type of the calling object and typecast it to the relevant application/document type.
Yes - you can just put your common functions into a shared DLL, just like any other application. Since each VSTO project targets a different application structure and potentially UI paradigm, I'd recommend having different VSTO projects in a single solution, and a shared assembly holding the common code.
VSTO doesn't support creating multi-host add-ins. You need to create separate projects for each host and use a class library for the shared code base.
Note, Add-in Express allows creating multi-host COM add-ins. So, a single add-in project can be run in multiple hosts. It comes from the IDTExtensibility2 interface. I don't know why VSTO creators didn't provide such feature to developers.
VSTO itself doesn't provide such an option. If you want to get single project for all application you can use shim add-in. That makes possible to run add-in in all applications from the same dll. The only issue -- your code need to handle what application started to call it to run separate logic or to call specific office API functions.
I am currently working on porting an existing wpf app to a universal windows app.
The existing application is fairly simple and is structured as a normal wpf project, containing the ui layer and filesystem interactions, and a class library containing the main application logic.
I was able to transfer the class library to a Universal Windows Library (windows 10 sdk) without making any substantial changes. This Universal Windows library exists in its own project inside the same solution as the original wpf application.
In order to minimize complexity, I would like both the upcoming Universal Windows app and the wpf app to reference the same library. However I am unable to add a reference to the universal Windows library from my wpf project. The library appears in the "add reference" dialog in visual studio, but after selecting the library and clicking OK, I am presented with a message saying that the reference could not be added.
Is what I am trying to do currently not possible, or is there something I'm missing? It seems foolish to need to save the same code into two different library projects for it to be usable.
You should be able to select the target frameworks of the class library by right clicking the project > Properties > Library and under targeting hit change, and select .Net framework X on your machine. Then, (aside from incompatible API's in your PCL) you'll be able to reference the project
I'm building a Prism WPF application and the main module loads a custom control for each device on the network. The custom control uses 3rd party Libraries from an SDK. The SDK is installed on the client machine in the application folder as a standalone installation as recommend by the SDK distributor to avoid future compatibility problems with other applications that also use the same SDK.
This SDK has a folder structure inside my application root folder and so the DLLs are not directly in the application root folder but in sub-folders.
A manifest file in the WPF application Shell allows my application to find the SDK DLLs in the sub-folders but my Custom control does not find the DLLs. If I manually place the DLLs my Custom Control needs into the application root folder on the client machine then my custom control works.
So basically, the main application uses the manifest but the Custom Control library doesn't.
The Custom Control is using Windows Forms Intergeneration to load an active X control in the main Prism module and display it in the WPF application.
Can I add an app.manifest to my Custom Control class library? ( GOOGLE says NO ).
Is there another solution?
On further inspection it's obvious that 2 of DLL's the Custom Control needs are not in the SDK and placing just these 2 DLL's into the Application root solves my issue. This means the Class library is using the Manifest to find the common DLL's in the SDK folder structure.
I am currently porting a legacy VBA application to a .Net application. During this process the users of the existing VBA application need to have some features added. So instead of coding them in VBA & then later in C#, I’ve wrote the new functionality in C# and I want to expose this to the existing VBA application through COM, as well as also keeping it in the currently .Net application version.
The solution contain several projects, 1 project for the UI, 1 project for Business Logic, 1 project for the data access layer.
The new features are just a some new forms to modify data. So ideally they will click on a form command button in access which lunch these C# forms via COM interop.
How should I go about exposing this forms through COM Interop.
What I was hoping to do was just add another project, MyProject.COM, which will contain my Interface ICOMManager, for exposing methods to access to launch the required forms. My COMManager class will just instantiate the required forms in my .net application and show them.
This project MyProject.COM will have references to the UI layer & Business Logic Layers.
When I want to register this project using REGASM how will I include references to these other projects?
Thanks for any help or advice on how about doing this.
Ah ok so i see this is alot easier than i thought.
Once i looked at the reg file produced by regasm i could see that the tlb (Type Library) is just a pointer to where it can find the libraries to execute the .Net component.
So once i register the tlb and make sure its pointed to the install directory where the rest of the project files are located it works.