everytime when i click on 'rebuild solution'. all my original class library .dll files get removed from their own projects. it looks like instead of copying the .dll files to the solution, it bugs to MOVE them instead, removing the old copy.
then i get a build error on the next rebuild, saying that the files cannot be found. so i have to open all the class library projects and build them all by hand.
::::::::::::::::::::::::::::::::::::::::::::
Severity Code Description Project File Line Suppression State
Warning Could not resolve this reference. Could not locate the assembly "ModelDatabaseClient". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Maybe you should look into using Nuget. I can work on projects on all the machines on my network, switching between machines on the network. Nuget package management keeps everything in sync with the projects. I also use TFS Express (free), a code repository,
too that allows me to work on the code switching between machines.
how can i store and publish/retrieve these packages?
When you use Nuget to install a DLL, a Nuget package into a project, where you will right-click the project to get to Nuget at the project level using Visual Stuido., then a package.config file is placed into the project. It's how VS and Nuget work together
to get the right DLL(s) into the project.
If you use TFS Express (free) as the code repository, the Nuget packages.config is checked into the repository with the rest of the project source code and they are controlled by TFS. So for instance, you could have a band new machine that doesn't have the
folder with for the VS solution. You can create the project folder for the solution on the hard drive, go to TFS and tell TFS to get the latest code for the entire solution including the packages.config file and start the build of the solution. And Nuget
and Visual Stuido will get the needed DLL(s) for each project placing them into the Bin folder.
An example of the packages.config for a MVC project. The packages.config gets created at the initial creation of the project. And then other packages were added as needed or removed ad needed.
everytime when i click on 'rebuild solution'. all my original class library .dll files get removed from their own projects. it looks like instead of copying the .dll files to the solution, it bugs to MOVE them instead, removing the old copy.
then i get a build error on the next rebuild, saying that the files cannot be found. so i have to open all the class library projects and build them all by hand.
::::::::::::::::::::::::::::::::::::::::::::
Severity Code Description Project File Line Suppression State
Warning Could not resolve this reference. Could not locate the assembly "ModelDatabaseClient". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
This type of issue is usually caused by a compiler error in one of the projects or one of the projects is running and the dll cannot be accessed or moved. The output or error list view in Visual Studio will show these types of errors on rebuild.
Otherwise, we'll need to know more about what you're doing to cause this error.
everytime when i click on 'rebuild solution'. all my original class library .dll files get removed from their own projects. it looks like instead of copying the .dll files to the solution, it bugs to MOVE them instead, removing the old copy.
then i get a build error on the next rebuild, saying that the files cannot be found. so i have to open all the class library projects and build them all by hand.
As mgebhard says, if your main application project has added reference for the class library application project, the VS will rebuild all the project when you rebuild the main application.
So you will find all the dll have removed.
If the VS find the class library is wrong and couldn't complie, it will directly remove the class libaray dll in the main project and show below error.
I suggest you could firstly check the class library to make sure there are noting wrong in it.
fazioliamboina
how can i store and publish/retrieve these packages?
If you want to restore all the Nuget package in your application, I suggest you could try to run below command in the Nuget Package Console.
# Restore packages for a solution file
nuget restore a.sln
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
there is nothing wrong with my class libraries. they build fine.
its just that instead op copying, VS litterally moves and removes the original copy on build. so the second build it cant find these .dll files anymore.
there is nothing wrong with my class libraries. they build fine.
its just that instead op copying, VS litterally moves and removes the original copy on build. so the second build it cant find these .dll files anymore.
I don't have this experience with VS. Is there anyway you can provide an example solution that exhibits this behavior? Perhaps you create a build event that moves files?
Cloud you please tell me which the VS version you have used?
If possible, please provide a test application for us to test.
Best Regards,
Brando
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
7 Points
236 Posts
bug in visual studio? building .dll dependant project removes .dll file from class library projec...
Jun 10, 2018 08:20 PM|uid390594|LINK
everytime when i click on 'rebuild solution'. all my original class library .dll files get removed from their own projects. it looks like instead of copying the .dll files to the solution, it bugs to MOVE them instead, removing the old copy.
then i get a build error on the next rebuild, saying that the files cannot be found. so i have to open all the class library projects and build them all by hand.
::::::::::::::::::::::::::::::::::::::::::::
Severity Code Description Project File Line Suppression State
Warning Could not resolve this reference. Could not locate the assembly "ModelDatabaseClient". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Contributor
4873 Points
4123 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 11, 2018 08:10 AM|DA924|LINK
Maybe you should look into using Nuget. I can work on projects on all the machines on my network, switching between machines on the network. Nuget package management keeps everything in sync with the projects. I also use TFS Express (free), a code repository, too that allows me to work on the code switching between machines.
https://docs.microsoft.com/en-us/nuget/what-is-nuget
Member
7 Points
236 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 11, 2018 09:26 AM|uid390594|LINK
interesting
how can i store and publish/retrieve these packages?
Contributor
4873 Points
4123 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 11, 2018 12:22 PM|DA924|LINK
When you use Nuget to install a DLL, a Nuget package into a project, where you will right-click the project to get to Nuget at the project level using Visual Stuido., then a package.config file is placed into the project. It's how VS and Nuget work together to get the right DLL(s) into the project.
If you use TFS Express (free) as the code repository, the Nuget packages.config is checked into the repository with the rest of the project source code and they are controlled by TFS. So for instance, you could have a band new machine that doesn't have the folder with for the VS solution. You can create the project folder for the solution on the hard drive, go to TFS and tell TFS to get the latest code for the entire solution including the packages.config file and start the build of the solution. And Nuget and Visual Stuido will get the needed DLL(s) for each project placing them into the Bin folder.
An example of the packages.config for a MVC project. The packages.config gets created at the initial creation of the project. And then other packages were added as needed or removed ad needed.
All-Star
52201 Points
23281 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 11, 2018 01:12 PM|mgebhard|LINK
This type of issue is usually caused by a compiler error in one of the projects or one of the projects is running and the dll cannot be accessed or moved. The output or error list view in Visual Studio will show these types of errors on rebuild.
Otherwise, we'll need to know more about what you're doing to cause this error.
Star
9831 Points
3120 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 12, 2018 05:52 AM|Brando ZWZ|LINK
Hi fazioliamboina,
As mgebhard says, if your main application project has added reference for the class library application project, the VS will rebuild all the project when you rebuild the main application.
So you will find all the dll have removed.
If the VS find the class library is wrong and couldn't complie, it will directly remove the class libaray dll in the main project and show below error.
I suggest you could firstly check the class library to make sure there are noting wrong in it.
If you want to restore all the Nuget package in your application, I suggest you could try to run below command in the Nuget Package Console.
More details, you could refer to below article:
https://docs.microsoft.com/en-us/nuget/tools/cli-ref-restore
https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore
Best Regards,
Brando
Member
7 Points
236 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 12, 2018 04:13 PM|uid390594|LINK
there is nothing wrong with my class libraries. they build fine.
its just that instead op copying, VS litterally moves and removes the original copy on build. so the second build it cant find these .dll files anymore.
All-Star
52201 Points
23281 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 12, 2018 04:59 PM|mgebhard|LINK
I don't have this experience with VS. Is there anyway you can provide an example solution that exhibits this behavior? Perhaps you create a build event that moves files?
Member
7 Points
236 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 12, 2018 05:47 PM|uid390594|LINK
no its a fresh install
Star
9831 Points
3120 Posts
Re: bug in visual studio? building .dll dependant project removes .dll file from class library pr...
Jun 15, 2018 09:08 AM|Brando ZWZ|LINK
Hi fazioliamboina,
I also never face this issue.
Cloud you please tell me which the VS version you have used?
If possible, please provide a test application for us to test.
Best Regards,
Brando