Visual Studio not picking up source code changes to control that is in a referenced DLL

MillenniumEBP

New member
Joined
Sep 3, 2022
Messages
2
Programming Experience
10+
I apologize in advance it this is a duplicate. I can't fine the one I tried to post yesterday.

I downloaded a library for use in my C# application. It has the DLL which I added the controls to the toolbox by referencing the DLL. The library folder also includes the source for each component. I need to make some changes to one of the components but I can't get my application to pick them up. As a test I added Debug.WriteLine to the component load method. I also added it to my application. I see that output but not the one from the control which leads me to think that my app is only using the control in the dll. How can I get visual studio to use my changed source code when it builds the solution?
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
6,068
Location
Chesapeake, VA
Programming Experience
10+
You need to add the .CSPROJ file to your Solution.

Read the following with a grain of salt since I don't use the VS WinForms Designer anymore after being burned enough times. Older versions of VS WinForms Designer used to be buggy where sometimes it wouldn't know that you have recompiled the assembly that holds the controls that you have added to the toolbox. Sometimes building clean was sufficient, but most times the workaround was to quit out of Visual Studio and then start it back again. I heard some people had luck deleting the .SUO file of just exiting and starting VS again wasn't enough. Note that this is how old my information is... I don't think the old .SUO file exists anymore, and it has been replaced by a SQLite file now.
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
4,759
Location
Sydney, Australia
Programming Experience
10+
You can right click your solution and select to add an existing project, then select the project file of that library. You can then reference that project in your application instead of the compiled DLL. You can then debug the library with your application if you want.
 
Top Bottom