0

I have an ASP.NET MVC project with one solution and 52 projects in the same solution. As you know, It takes long time to build whole solution. So I decided to unload some of the projects until there is some change or sprint task in the code in the unloaded project. However we are a team and use TFS version control and we need to use update unloaded assembly. So I have a build server that makes me sure whenever somebody starts to check-in (for example -> C:\bin in our network) the last version of all assembly can be found there.

I added C:\bin path as Reference Path to the UI Project (main project of the solution) of the solution and I expect when some projects is unloaded the reference comes to visual studio from the build server path (C:\bin) otherwise the reference of the project comes to Visual Studio from the nested project (not from build server).

enter image description here

But the reference can not be found when the project is unloaded:

enter image description here

And my Build server contains the assembly:

enter image description here

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
  • 1
    If you unload the projects, then the build will fail because other projects have dependency on the unloaded project. There are 2 ways to add a reference, you can either add a reference to another project or you can add a reference to the project DLL. So one solution would be to split your solution to let's say 2 solutions... then build your solution one and add the dependencies as a DLL files... even more elegant would be to put your DLLs in Nuget, and install them as Nuget packages. – Hooman Bahreini May 24 '21 at 06:53
  • 1
    [This answer](https://stackoverflow.com/questions/61468997/switch-between-source-code-and-precompiled-binaries/61517579#61517579) might help. – Hooman Bahreini May 24 '21 at 06:56
  • Thanks for your reply. But I want to use Reference Paths in Visual Studio As I show in the picture – Alireza Ahmadi May 24 '21 at 07:34
  • How do I know the project is unloaded? I want to use condition in Reference tag in web.config to switch between class library (.dll) and debugable project – Alireza Ahmadi May 24 '21 at 10:55
  • 1
    You can't switch between between dll and project, the question that I have put in the comment above is asking about exactly the same thing, I think it would answer your question. – Hooman Bahreini May 24 '21 at 11:02

1 Answers1

1

Finally I found a way (only in Visual Studio 2019) to unload projects and however use updated class library of unloaded projects. And thanks to Hooman Bahreini for his idea of using two separated solutions.

The way is that, there is a feature of Visual Studio 2019 that we can Save As Solution Filter which is in .slnf extensions. So I can unload some of my projects and check-in .slnf file via my source control (like tfs). So I have two solutions Now, one is .sln which is contains all of projects and the other one is .slnf which is unloaded some of projects in it.

The things can we do is that whenever I want to get my project I have to use .sln file and builds that and then close the file and then open the .slnf file (I'm sure that I have updated class library of unloaded projects) and do my task and check-in my changes.

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42