nklhead
nklhead

Reputation: 326

NCrunch Won't Build After Deleting Extra Solution Configurations

We had a solution with several additional solution configurations beyond the typical Debug and Release, and are going back to simply a Debug and Release. A few projects did not have a Debug build, or did not have a Release build.

I have:

  1. Re-added Debug and Release to each project where missing
  2. Changed solution config to Debug
  3. Deleted the extra solution configurations
  4. Changed each project to Debug (projects now match solution)
  5. Deleted the web.*.config transforms

NCrunch is now reporting:

The OutputPath property is not set for project 'nCrunchTemp_fab725ec-f404-4afe-9916-c4edb033c2bc'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Local' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

NCrunch: This error is commonly caused by projects that are relying on the selected build configuration provided by Visual Studio in order to set the $(Platform) and $(Configuration) MSBuild properties during a build. Unless configured otherwise, NCrunch will normally use the default $(Configuration) and $(Platform) properties that are specified in a .proj file - thus in order for your project to build with NCrunch it must be possible to build the project using command line MSBuild without needing to manually inject build properties. You will most likely need to edit your .proj file to align its default $(Configuration) and $(Platform) properties with the property groups provided in the file.

"Local" is one of the old solution configurations.

I have looked for where NCrunch is picking up Local and cannot find it in any of the config screens or files.

The solution builds from Visual Studio in both Debug and Release configurations. It does not build with NCrunch. I've tried closing and reopening VS which made no difference.

Upvotes: 2

Views: 420

Answers (1)

nklhead
nklhead

Reputation: 326

Two additional changes were made - manual edits to the project file.

  1. Project file still had default set to Local:

    <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Local</Configuration>`
    

    Manually edit this to say Debug.

    That fixed most of the broken projects. One was still broken, with exact same error. In that project, the above which sets the output path appeared BEFORE the property group which sets the default configuration. Thus, when the output path was evaluated, the configuration was blank, instead of Debug.

  2. This line needs to appear after the default configuration line:

    <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
        <OutputPath>bin\</OutputPath>
    </PropertyGroup>`
    

Upvotes: 1

Related Questions