everyone, I am having a question or problem when building a setup project for an add-in (both are developed in c#). The add-in is used for a big software, and it needs a DLL from the software. If I just build the add-in and use it, it is fine. But if I install it using a setup project, the DLL provided by the software should also be copied to make the add-in work. But since if the client who uses the software, has already the DLL (coming along with the software), so I wanted to skip this DLL, so exclude it from the setup. But if I do so, I will get error 1001 when installing the add-in, saying at least one type from the assembly (the add-in) cannot be loaded. If I include everything (all the dependencies), it works.
So does anyone have idea about this? How can I skip the already available DLL that comes along with the software?
you can use web deployment project to build your application instead of the default publish in visual studio and before building it right click on the WDP and select Open Project File:
inside the .wdproj file search for item group <ItemGroup></ItemGroup> tag and add the following
<ExcludeFromBuild Include=”$(SourceWebPhysicalPath)\FolderName\**\*.*” />
Related
I am writing a plugin for a 3rd party app (which I only have the .EXE and dot net .DLL for).
The way I code the plugin is by creating a Visual Studio C# library project, add the .EXE and .DLL files from the 3rd party app as references, then extend the IPlugin class defined in the .DLL.
After I build my project I take my plugin's .DLL and copy it to the 3rd party application's Plugins directory then start the application. From that point on I really don't know what happens at that point. I guess the application dynamically loads my DLL by scanning the Plugins folder then loads it (all that stuff I know nothing about).
At that point the application is running as a .EXE.
Is there a way I can use Visual Studio to attach to the .EXE (process) and then debug my DLL code that's running from withing that process?
I know my code is "in there" somewhere but since it's not an .EXE I don't see how I could attach to it.
Thank you,
Jan
This is an old question, so you may already have the answer. Still, in case it helps:
You didn't mention which version of Visual Studio. I do what you are asking about all the time with a C++ DLL in VS 2010. Open the property page for the Debug configuration. Under "Debugging" set "Command" to the host EXE (including path).
You should also set the output directory (General->Output Directory) to the plugin folder for your host, so that it will load the debuggable version when you hit Run.
I made a little app with c# which I wanted to send to a friend to get an opinion. Problem is when I selected release configuration and click rebuild I get 7 additional files(3 dll's, 1 exes,...) along with the exe I want. Am I doing something wrong? I used to get single .exe files back when I used c++ with VS 2005.
You are not doing anything wrong. Its just that at release additional files are generated like AppConfig.xml for instange that holds your application settings, or a ClickOnce deployment package so that your friend can install the app. To get more used to c# you can start by googling articles about the differences between debug and release
Have you considered using the Click Once facility built into Visual Studio 2012?
Click Once Deployment - MSDN
Click Once will generate an installer that will that your friend can execute. It will automatcially download and install any dependencies (such as a specific .NET Runtime) if necessary.
To distribute referenced DLLs look at the following URL as it suggests the correct configuration settings:
How to: Specify Which Files Are Published by ClickOnce
It's been an horrible hour. Couldn't get Clickonce working for such a simple app. Moving just the 3 referenced dlls and the exe to another folder worked. Wix on the other hand...is difficult to say the least.
However, this allowed me to create a single setup file if not an exe in 10 mins. I sent a shortcut to the desktop which is more or less what I want.
To build an Autocad application I use C# 4.0.
My application has two module one for 2005 and another for 2010 autocad. it uses special dll's of autocad ,but face some difficulty of finishing it up .All should be universal for 2005 and 2010 autocad since dll's has the same name it was impossible for the app to differ autocad versions.it create problem for autocad interop dll's in reference.help me to use different dll for different module.
Application has two modules(2005,2010)
Special dll
2005 and 2010 dll has same name.
Application fail to distinguish dll
Help me to use different same name dll in one application.
Note:In individual project they work perfectly.
need help to use same name dll in one application .
If have any query please ask ,Thanks in advanced.
I've a similar application, it works for autocad from 2006 to 2013 (both x86 and x64) and for bricscad v12-v13.
To solve it I did a visual studio project for each architecture, each of those projects refers different .dll depending on autocad version. In particular each of those projects refers AcDbMgd.dll, AcMgd.dll, Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common, those dll are specific for each autocad architecture.
You have to pay attention that all of the referenced dll are in copy local FALSE!
In my case all the projects are compiled in different folders but it's not obligatory if you assign a different assembly name for each project.
Thanks to the fact that AutoCAD API are the same from 2006 to 2012 (2013 has some differences), the source code is separated from those projects, each project include it as a linked source file (go to the project in the solution explorer -> right click -> add existing item -> select the source file and press "add as link"). In this way you have the same source code for all the projects but they are compiled including different autocad dlls.
In my case there were also some troubles because BricsCAD has sometimes different API with respect to AutoCAD. To solve this few cases I've set a conditional compilation symbol and used it like so:
#if BricsCad
CADAPI.ApplicationServices.Application.SystemVariableChanged += new CADAPI.ApplicationServices.SystemVariableChangedEventHandler(Application_SystemVariableChanged);
#else
CADDB.LayoutManager.Current.LayoutSwitched += new CADDB.LayoutEventHandler(Current_LayoutSwitched);
#endif
Tell me if you need further information. BTW I think your main problem is the copy local = true for autocad Dlls.
I have a Visual Studio 2010 solution that contains 3 projects: a dll project, an executable project, and the Installer project.
I am working on the dll and the executable concurrently. The executable is simply a front end for the library. While developing the two in Visual Studio I simply added a reference to the dll project from within the executable and it works fine.
What I'm having trouble with is the deployment. Ideally the dll would be compiled and installed in a subdirectory of the executable. Using the "Visual Studio Installer - Setup Wizard" project template for my installer doesn't seem to be giving me the options I need.
Am I going about this wrong by developing my backend and frontend in different projects? What steps should I take to deploy the compiled dll along with the executable? I may be going about this all wrong, so please help me understand a better methodology if this seems backwards. For all the programming I learned in college, no one ever went over what I do when I actually want to deploy my software.
Since the DLL project is explicitly referenced from the EXE project, it is automatically copied in the EXE's build folder (i.e. bin\Debug or bin\Release) and is considered part of EXE project's "primary output". As a consequence, you only need to reference the EXE from your setup project.
The installed DLL will be in the same folder as EXE. Why would you want to install the DLL in a different folder on the user's machine if it is not there on the development machine? If you are loading it dynamically and using reflection, then don't reference it from EXE, but do reference it from the setup project, which then gives you the power to set whatever target folder you want.
This is what you need to do.
On your Solution create new Project > Other project Types > Click Setup and Deployment
On The Application Folder > right click > Then Add your front end Application > Build.
Check this
Regards
I have a DLL I need to deploy with my C# application. It's not currently included in the installation package when I hit "Publish" so how do I include it?
Would the process be any different if I had app.config and other files I wanted to deploy with my application?
If it's referenced it should be included automatically. I've deployed a couple of apps that require a 3rd party dll and they've published OK.
Is the dll referenced correctly in your project? That's the only thing I can think of at the moment that might be the problem, but if it wasn't your code wouldn't compile and/or link anyway.
To get the xls file to deploy all you need to do is add the file to the solution and then set the "Copy to Output Directory" property on the file.
I take it you are using Visual Studio?
If your using Visual Studio 2008 (I have no experience with Visual Studio 2005) under the Publish tab in your project properties click on the Application Files button. This will bring up a list of all dependencies assembalies required by your project. If you find that required dll is not being published by the Visual Studio publisher tool by default you can go into here and set the Publish Status of the offending dll to Include.
Sometimes in my more complicated projects, depending on the type of dependency, I have to go into this menu and force certain dll's to be included opposed to the default Prerequsite setting.
...but this is all under the assumption you have the assembly properly referenced in the required projects and everything is compiling fine.
Can't you add the dll as a resource to your installer project?