Modify c# Windows Forms control library - c#

I have a c# Windows Forms control library, but there is no sln file with it.
I would like to modify this project, so I think I need an sln file to open it and create an other dll.
I tried a solution, but it did not work.
I create a new c# Windows Forms control library, I named it as the original library name.
I renamed the UserControl1.cs as the original mainfile name.
I bult it, it has worked, yet.
After that I copied all of the .cs files from the original library to the new library.
Of course overwrite the new files with the original files.
I tried to build it again, but I got an error message: "dll does not contain any usercontrol types"
The original folder contains a __csproj.user file, but my new project does not contain it.
What did I wrong? How can I modify the original c# Windows Forms control library oe how can I create an sln file for it?

If you don't have .sln file, that's fine visual studio will create it for you when you open a .csproj file and try to save the project.
All you have to do is open the .csproj file in visual studio and save it.

Related

Xamarin in Visual Studio File import to Solution

I Try to Open a file within Xamarin.
I followed this tutorial:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/files/#Loading_and_Saving_Files
The File that i wand to open seems to not exist.
It opens the path "/data/user/0/SQL2.Android/files"
I tried all different properties on the file.
I don't know if the file I want to open is in the Solution. It should be.

Resources folder in Visual Studio

I write you all for a problem with my c# library. It needs an XML file that uses as a dictionary. Since the files will not change I would like the dll already contained the file and requires no memory references to it.
System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(#G:\Project\dictionary.xml");
So I put the XML file in the "Resources" folder of visual studio, but now I do not know how to get that file. If you always use the memory reference to use the library without also enter the file, it does not work. How can I do? If I open the dll with a notepad I see that the XML file is in.
This should give you an idea:
add a *.resx file
drag and drop you XML File onto it.
Use it!

C# Google Chrome Extension, where is my bin/debug path?

I am working on a Google Chrome Extension and I need add a library to my project.
I know how can I add the library but there is a problem I have.
First, I added .dll file into my referance.
Than, I need a debug folder in my bin folder. Normally, bin/debug file create automatically when you create new project in C#. But when I create "Chrome extensions project" the file path didn't create. I created manually but it didn't worked.
I created a console app and I tried add my library into the project, it worked. What should I do?
There is no bin\debug folder in the Google Chrome Extension project. The output is the zip file (not dll or exe), that contains the files from the app directory. You register this zip file as an extension.
You can't build Chrome extension using c#.
More info you can find here: https://visualstudiogallery.msdn.microsoft.com/c11cd639-2abb-4243-96d2-153c0adb494a

How to modify static text in rdlc file?

I have a rdlc file and I try to modify a static text on the file, but when I start the program the text in the form is not modified. I use VS C# 2008 Express. What should I do to be able to modify the text in rdlc file?
You mentioned in a comment that the main form and the report are in different projects. You also stated you added the reporting.dll as a reference to the main project. What MAY be the problem is that you added the actual .DLL of the other project as a reference to the first from "some" location.
In your main solution, did you add your reference and use the tab for "Projects" and pick the project itself? (as opposed to picking a .net library or browse for the physical .dll file.
When you add a reference to the PROJECT, it becomes part of the solution and ultimately part of the building dependency order. The main project would see the project, force to rebuild it, then take a copy of it's final .dll file and pull it into it's own building folder so it always has "the latest" of the underlying reference .dll.

What files are needed to "show C# code "?

I am new to SO and also to the C# language. I browsed for a bit and was not able to find anything relating to this subject. I program in other languages, mainly C and C++. When I want to show someone my code I show them the .c or .cpp files and any header files I have created.
However, if I want to show the source code to a program in C# what do I use?
It is especially confusing when I create a new WindowsFormApplicaiton
Technically all you need is the .cs files, but to make it easy on the person receiving this (and assuming you are using Visual Studio) just take the entire Visual Studio project directory (should include a .sln file, one or more .csproj files, all the .cs files, and any other assets) and zip/rar it.
The user on the receiving end can unzip the whole structure and double-click the .sln file, and they will get the same view in Visual Studio that you had.
A little more detail:
Forms are still just c# (.cs text) files.
The .csproj is an XML file that contains pointers to all your .cs files, as well as some project metadata.
The .sln file is an XML file that contains pointers to all your .csproj files, as well as some metadata about source control, project relationships, etc.
When you create a Winforms application, you get two .cs files: Program.cs and Form1.cs. When you are looking at the form, you can right-click on it and choose View Code. This is called a "code behind", and is where the implementation of the form lives.
You can use notepad (open the .cs file) or visual studio. If you don't have a pro copy you can use one of the express editions of visual studio. When in VS you can right click on the form and select View Code. I hope my response is on track with your question!

Categories