Search code examples
asp.netvb.netwcfwebformsmultiple-projects

How to "Import" a "web site project" app code into a new project, all in the same solution.


we have an ASP.NET web forms w/ VB code-behind intranet "web site" project. It is time to split this out a bit as we have Intermec scanners that now need to use them. My idea is to have 3 separate "web sites" all under the same solution. 1 will be our main site. 2 will be the scanner or "mobile" site. 3 will be ajax WCF services. I wanted to see if this seems like a logical set up and if so; what is the best way to share code between the web sites. Ideally, most of our app code will eventually in the services web site. But this will take time to switch it over. Until then I need to be able to share calls thru all three of the sites.

I swore I read that I could just "Import" the app code file (since it is all in the same solution) and I would have access to the code.

Thanks! Josh


Solution

  • The solution we came up with was to add a new class library to our solution. This keeps the web site project separate and then we added a reference to our website pointing to the class library. We slowly are move the App Code from the website to the class lib, importing the necessary namespaces to the class library as needed.