Search code examples
c#dllclass-libraryweb-reference

Creating class library project from winform


I have a winform project (from a different person, I didn't build it), that uses a web reference. I want to create a new project - class library project - based on the winform project (without GUI).

I tried to copy some of the files but I can't copy this web reference, I don't even have a directory "Web References" in my new project. When I click on the web reference that I want, I see on the properties "Url Behaviour - Dynamic" and "Web reference" - a url in my computer that does not exist (but the old project works!).

When I enter to the web reference directory on my file explorer I can see files there but no dll so I can't add it to the new project..

What's I'm doing wrong?


Solution

    1. Change project options from Windows application to class library.
    2. Compile it and you get the dll.
    3. Create a new WinForms project and add this class library project as reference. (You might need to move some files from the class library to the WinForms project sometimes.)