Why is Visual Studio looking for unresolved project references in / bin / debug / during release build?

I am dealing with a strange, imperfect project / solution architecture, and I am trying to figure out if there is a way to accomplish what is needed. My situation is this:

I am working on software that breaks down into two solutions, which I will call SolutionOne.sln (which is created under VS 2010) and SolutionTwo.sln (which is created under VS 2013). At SolutionOne, we have the following projects:

SolutionOne.sln

  • A.csproj
  • B.csproj
  • C.csproj (includes a link to B.csproj)

In SolutionTwo, we have several projects that are unique to SolutionTwo, but we also include the β€œC” project of the SolutionOne project, but not (since outside of this minimum example, there are actually some more linked links, and by the time we included them all, basically that would be most SolutionOne). I understand that this means that when we open SolutionTwo, project β€œC” shows an unresolved reference to project β€œB”, because it is not included in our second solution.

However: as long as I create a SolutionOne before SolutionTwo, in the Debug configuration, the builds will be successful, and our application will function. It seems that during the build, Visual Studio is smart enough to grab the built DLLs for the missing reference to project β€œB” from their locations in the SolutionOne assembly, as these two solutions share the root directory. However, when I try to create both solutions in my Release configurations, I get the following error:

C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.CSharp.targets (316.9): error MSB3104: assembly reference "[project path] \ bin \ debug [ProjectReferenceName] .dll" was not found. If this assembly is created by another of your projects, be sure to create this project before creating it.

Note that in this error message, it seems to be examined in the correct bin folder, but it looks in the / debug subdirectory instead of / release, even if both solutions are built with their release configurations.

I understand that this is not an ideal use of the relationship between projects and solutions, but it is unlikely that I will be able to reorganize the way it is developed at this stage. Is there a way I can get Release assemblies to correctly search for an unresolved Project Reference DLL in the / bin / release / directory, as you would expect?

+5
source share
2 answers

Check out the C.csproj file.

You can reference B.dll on a hard-coded path that explicitly refers to \ bin \ debug \

Edit: @sphanley: In this case, check B.csproj. Verify that ReleasePath is installed correctly. Sort of:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <PlatformTarget>AnyCPU</PlatformTarget> <OutputPath>bin\Release\</OutputPath> <DefineConstants>RELEASE</DefineConstants> <Optimize>true</Optimize> </PropertyGroup> 
0
source

Ensure that your Build-Configuration Manager Active configuration configuration is set to Release and the Build column has check boxes for each project in the solution.

0
source

Source: https://habr.com/ru/post/1241070/


All Articles