C# Add external user control to project - c#

I'm working on a windows form application in C# VS2010.
I found on the internet an implementation of a User-Control that I want to use in my project.
Problem: how can I import or include it so I will be able to see it in my Toolbox ?
I copied the UserControl directory into my project directory(see attached photo)
and then build the project and got this warning:
Error 1 Unable to create a manifest resource name for "RecessEditorControl.resx". Could not find file 'C:\Users\bassam\Desktop\comm\Projects\Thunder Archive\Thunder Archive\RecessEditorControl.cs'. Thunder Archive
any idea how it should be done?

Open the user control project separately (outside of your solution) and attempt to build it.
If the build fails, search for help from the control author(s) on what dependencies are needed and how you can build the control.
After you get it sucesfully built, there will be a .dll file in the bin/ folder (where config is most likely debug or release, depending on what configuration you used to build the project)
Reference this .dll from the windows desktop solution you are working on. Add it to the references section of your UI project.
It should automatically show up in the toolbox if it is properly coded as a user control.
There is the option of including the entire source project of your control in your win app solution, you can try this later if you verify that you are able to build the control on it's own.
Although I would not recommend this approach unless you intent to actively continue developing the user control.

You separately build user control to create a dll. After that include the dll in your app executable folder. When you switch to designer, you will see the control appears on the toolbox with the control name. Just drag n drop...

Related

How to have a custom control pull over all required files when used from Toolbox

I have created a custom control for my development team to utilize the CefSharp Chromium Web Browser. I have everything setup and working well. The only problem is having it run for projects that do not directly reference the chrome project in their solution.
I would like to find a way for when a developer drag and drops my custom control into their application, it will automatically copy ALL of the required files from the compiled control to their bin folder.
Currently, it only pulls the handle full directly referenced by the tool, but some are utilized at run time due to limitation of the utility for being able to compile for Any CPU efficiently.
Image of Files
I would like to have all of the files on the left hand side be copied automatically upon using the control from the tool box to the appropriate folder, or at the very least at run time.
Any information or ideas on where to look are greatly appreciated.
I managed to solve the problem, though this feels like back practice.
My issue what using CefSharp and getting all of the x64 and x84 files downloaded where ever require. I ended up adding a zip file of each content and then extracting them at run time as needed.

Multilingual App Toolkit build completed with errors - TFS read only files

I have added Multilingual App Toolkit to a ASP.NET web form application, in this application is used TFS for version control.
My problem is that every time the application is build Multilingual App Toolkit need to update the files, but it does not check out files before compile and so generates an error:
"Update xliff build failed, one or more errors occurred, multilingual app toolkit build completed with errors"
If I check out the files he can build normally.
What can I do about it?
You should remove any generated files from source control.
It is bad practice to put either binaries or generated code under source control. Source control is for the configuration that is used to feed the generation. If you need to add custom changes to the code after it is generated you should use partial classes.
You should delete all of the generated files in the solution explorer and then checkin. Make sure that you remove the files from the projects and solution as well.
After that everything should build, and continue to build correctly.
Note: Always take a full backup of your files before you make changes.

Where to get Microsoft.practices.composite.unityextension.dll

Where to find Microsoft.Practices.Composite.UnityExtensions.dll for Microsoft.Practices.Unity.dll thats of version 2.1.505.2..
I was using 1.2.0.0 version of unity dll . While i changed the version to 2.1.505.2 the code gave me an error saying unityextension is depenedent to 1.2.0.0 version of unity dll ...
the version I am using is 2.0.0.0 of unityextension.
I really need help .. thanks in advance
Follow below steps as documented in official website :-
1.In Visual Studio, create a new Silverlight application. To do this, point to New on the File menu, and then click Project. In the Project
types list, click Silverlight in the Visual C# node. In the Templates
box, click Silverlight Application. Finally, set the project's name,
such as CALApplication1, specify a valid location, and then click OK.
This project will be the Shell project of your application.
2.On the Add Silverlight Application dialog box, make sure the Add a new ASP.NET Web project to the solution to host Silverlight option is
selected, and then click OK.
3.(Optional) In Windows Explorer, create a folder named Library inside your solution's folder, and then copy the following assemblies into
the folder
â—¦Microsoft.Practices.Composite.UnityExtensions.dll. This assembly
contains base and utility classes you can reuse in applications based
on the Composite Application Library for Silverlight that consume the
Unity Application Block. For example, it contains a bootstrapper base
class, the UnityBootstrapper class, that creates and configures a
Unity container with default services when the application starts.

Add Visual Studio solution to existing solution in Visual Studio

I wrote an application in Visual Studio C# 2010, that I would like to import into another existing Visual Studio C# 2010 Application. How would I go about doing this?
For instance, I'd like to import the project into another, and basically copy/paste the interface from the application into a tabpage on a tab control I have.
Any assistance or advice on how to do this is greatly appreciated!
You should be able to copy the physical files using windows from the existing solution location to the new solution location.
Then once the copy is complete open Visual studio and tell it you want to add an existing project. Navigate to the folder where the files are on the filesystem and open the project file.
Once you save the solution it should from that point forward have the new projects in the new solution.
There are several ways to achieve this - Copy & Paste being one of them (but the least beautiful of course). A more promising one is the following:
Wrap the user interface you want to share in a User Control in the existing project. Also include the code behind logic in this user control. Include the user control in the project and make sure that everything works before continuing.
Add the existing project to the new solution. It is advised that you create a hierarchical structure in the file system for the solution so that all projects in the solution are located under a directory.
Reference the project from the project that wants to access the user interface. As the projects are in the same solution, you can add a project reference. This asserts that the projects are built together.
Place the user control on the tab page.
As an alternative, you can also pass on adding the project to the solution but only create a user control and add a binary reference from the other project.

How do I embed a banner image and or add remove programs icon in my setup project?

I'm using a setup project in visual studio 2010 to create an installer for a program I'm working on. I want to have a custom banner image in my setup as well as a custom icon in add remove programs.
I've added both these images to the "Application Folder" of my installer and was able to get them to show up correctly. However, my program is not very big and only installs as an EXE and a few DLLs. So it seems a little silly to me that the 4th and 5th files that get "installed" are graphics only used during installation.
Is there some way I can embed these images in the installer or one of my other projects?
I'm currently using VS 2008 and just been playing around with the setup project. I believe the following works - it did in my tests.
Select the setup project in the solution explorer window.
Right click and select Add/File
Find your banner Image file and add it.
You will see that it's been added to the Application folder.
Select the banner file in the application folder - or in the project list on the solution explorer.
Open the Properties Window
On the properties set "EXCLUDE" to TRUE.
When you set exclude to true you will see the banner file removed from application folder - but it will still be shown in the project tree - the icon will for the file will have a little red circle with a line through it.
I've done this with both the banner and a custom icon and tested my install - worked fine with both and neither file showed up in the application folder.
Hope this helps.
In the setup project properties you can put an image for the add/remove icon in the property AddRemoveProgramsIcon
For the banner image, right click on the setup project, View -> User Interface, click on the page you want, and then in the properties you want the BannerBitmap property.
This blog discusses a way to change the banner image without modifying the Visual Studio project.
If you want to change of the icon of the application EXE, then you just need to right click on the EXE and "create shortcut". In the properties you will find the icon and you can change it.

Categories