question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build ASP.NET Core project using net461 and x64

See original GitHub issue

All my projects are locked to x64 configuration (AnyCPU is deleted) because, well, it only runs on x64 and depends on x64 native binaries.

My ASP.NET core project is configured to use net461 as I need to the full .net framework in order to reference the Microsoft.WindowsAzure.ServiceBus nuget and to reference my class libraries.

project.json excerpt:

   "frameworks": {
    "net461": {} 
  },

  "runtimes": {
    "win7-x64": {},
    "win8-x64": {},
    "win10-x64": {}
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "platform": "x64"
  },

Building the project now gives me an error:

2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'BlackCat.Automation.Messaging.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.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'BlackCat.Core.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.

I’ve tried manually changing the Any CPU => x64 in the sln file but it reverts back once you build the project.

Any ideas?

EDIT: Even after adding the AnyCPU configuration for the two projects referenced here, the project built successfully but while I tried to publish with win7-x64 runtime, it built the win10-x64 and couldn’t find the output files. Switching to win10-x64 failed to start the app on Windows Server 2012 R2.

It seems to me that the whole .NET core ecosystem is very messy even at RC2 when it comes to supporting anything “non-standard” (limited to .NET Core apps). I would love to see an example project with this configuration: .NET Core APIs, to get advantage of all the goodies such as webpack etc but with reference to net461 - not all of us are interested in deploying to Linux right now…

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:14

github_iconTop GitHub Comments

2reactions
Abdruggicommented, Aug 21, 2017

The problem is back with core 2.0… Setting RuntimeIdentifier does not help anymore…

2reactions
vsDizzycommented, Jul 11, 2017

A workaround is to ‘Unload a Project’ and edit runtime version in your .csproj file manually.

  <PropertyGroup>
    <TargetFramework>net47</TargetFramework>
    <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
  </PropertyGroup>

It is very straightforward and works like a charm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build ASP.NET Core project using net461 and x64
My ASP.NET core project is configured to use net461 as I need to the full .net framework in order to reference the Microsoft.WindowsAzure....
Read more >
New ASP.NET Core Project does not build; "The framework ...
How do I create an ASP.NET Core 2.2 project that builds correctly? I noticed the error message complains about 2.0.9 , why isn't...
Read more >
Troubleshoot .NET Framework targeting errors
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the projects...
Read more >
Fixing issue related to Package is not compatible with ...
Solution: Create a "NuGet Tool Installer" task ... The solution was very simple, once figuring out what the culprit was. ... Once this...
Read more >
NET Core RuntimeIdentifier vs TargetFramework
I have web api with referenced .net core libraries. ... The current project targets multiple frameworks, ... But now I even can't build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found