Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Doesn't work with projects without an 'AnyCPU' configuration #3

Open
zaps opened this issue Dec 3, 2012 · 3 comments
Open

Doesn't work with projects without an 'AnyCPU' configuration #3

zaps opened this issue Dec 3, 2012 · 3 comments

Comments

@zaps
Copy link

zaps commented Dec 3, 2012

Most of our VS projects have AnyCPU build configurations removed, instead using specific configurations such as x86 or x64. NuBuild projects seem to want an AnyCPU configuration on projects that are referenced to them.

I think the fix would be to allow NuBuild projects to have other configurations like x86 and x64 so the Platform property can match that of referenced projects.

Here are the steps to reproduce:

  1. Create a new empty Visual Studio solution.
  2. Add a new empty C# console application project to the solution.
  3. Add a new NuBuild project to the solution.
  4. Add the C# project as a reference to the NuBuild project.
  5. Ensure NuBuild project builds without error.
  6. Create an x86 configuration for the C# console application project and the solution.
  7. Remove the AnyCPU solution configuration and C# console application project configuration (NuBuild project configuration cannot be changed or removed)
  8. Build the solution.
  9. Compilation fails with error:
    The OutputPath property is not set for project 'NuBuildTest.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
@brentspell
Copy link
Owner

I'll have to take a look at the mechanism for managing configuration/platforms in the VSSDK. It is not provided by the project node base class. In the short term, you should be able to modify the .nuproj file to include the configuration/platform property groups needed by your projects.

@lmagyar
Copy link

lmagyar commented Sep 26, 2013

I think the SubType based version could implicitly solve this problem, Solution Properties / Configuration Manager will handle the platforms in the NuBuild projects.

lmagyar added a commit to lmagyar/NuBuild that referenced this issue May 12, 2015
Use Configuration and Platform settings from the solution file when
collecting the referenced project's output .dll files. Previously the
default values were used.
lmagyar added a commit to lmagyar/NuBuild that referenced this issue May 14, 2015
This small modification solves, that MSBuild doesn't want to rebuild,
just gives back the TargetOutputs.
lmagyar added a commit to lmagyar/NuBuild that referenced this issue May 15, 2015
GetTargetPath target returns the TargetOutputs to VS/IDE when VS/IDE
requests the outputs of the projects for the reference dialog. We let
GetTargetPath to believe that NuBuild projects are .exe projects to let
them be able to be used as referenced projects. This has no effect
during real build, GetTargetPath is used by VS/IDE. But now we have to
filter out these .exe results from the TargetOutputs/ReferenceLibraries
list.
@lmagyar
Copy link

lmagyar commented May 18, 2015

With combined AssignProjectConfiguration and MSBuild tasks it is possible, that the projects referred by the NuBuild project will build with the proper configuration and platform (defined in the .sln or build definition) and not the default AnyCPU. So, the NuBuild project remains AnyCPU, but the referred projects can be set to anything in the Configuration Manager (x64, x86, Win32, etc).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants