Search code examples
c#classsolution

Reference c# class through multiple solutions


I have 2 separation solutions. One is done using MVC (Solutions 1) and the other is done using Web Forms (Solution 2). I have a class in one of the solutions (MVC one) that I like to use in the Web Forms solution. How would I reference the class in Solution 1 through Solution 2?


Solution

  • It depends on where the class is located. Ideally you would move your class out into its own project so that you can add the project to the other solution. You could also add an existing item from your MVC solution but this can lead to all kinds of dependency problems and shouldn't be done.