Search code examples
.netasp.netvb.netwinformssolution

Including a ASP Web Service Project in a Windows Forms Application


I have a web service that I'd like to include as a project reference inside a windows forms application. (The application will be running on non-networked hardware.) I could simply copy the *.vb files I need into my forms project, but I'd rather not fork the code base.

It wasn't hard to include the ASP project in the windows forms solution. However, I can't figure out how to reference it in my forms code. Is this even possible?


Solution

  • Assuming that you're not trying to call the web service, and just share the implementation details, you could move the common code into an assembly shared by the two projects, or even just link the code files into your second project rather than copying them there.

    To add linked files:

    1. Right click on your project
    2. Select Add -> Existing Item...
    3. Select the file(s) you want to add
    4. Click the little arrow on the edge of the Add button, and select "Add As Link"