Closed georgiosd closed 6 years ago
Any updates? Issue still around, VS "fixes" the sln
file and hardcodes Any CPU
and then fails to build asp.net core project complaining one of its dependencies does not define Any CPU
(of course it does not, it cannot in my case as the dependency is Service Fabric stateless service). Seriously frustrating experience considering such stateless services are officially recommended approach for out-of-cluster communication solution
Matt compiled a repro here
I'm running into this issue as well. I'm using a shared PCL and need my ASP.NET Core service to be x64 & 4.6.1 for Azure Service Bus communication. If you set it to x64 in the configuration manager, it is automatically set back to Any CPU.
+1
We REALLY need a fix for this. This issue relates to my problem described here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/9b733a3b-2b65-416b-b2bd-15080b51f57b/referencing-project-does-not-build-using-the-same-or-an-equivalent-configuration-or-platform-error?forum=AzureServiceFabric
I've managed to get a version working by using VS2017, I'm going to update the repo https://github.com/mattridgway/Service-Fabric-Error to show it working. It looks like the VS2017 tooling has fixed this, although your class libraries holding the interfaces MUST target the full .NET framework.
I ran into the same issue, with vs 2015 sp3, with full .net 4.6 (don't support Azure though, but has anyone found a workaround? - or some fix from ms?
+1. VS 2017. Create a new asp net core with .NET full framework. Project properties - change from x86 to x64. Web deploy publish to IIS. 502.5 error. Would be nice to work under x64! :)
Why can we not run under x64 or Any CPU?
+1 New Project in VS2017. Change to x64. Debug - BadImageFormatException.
I have problem with net452 and x64 as well. AnyCPU was fine, x64 causes problem.
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.
The problem is back with core 2.0... Setting RuntimeIdentifier does not help anymore...
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.
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:
Building the project now gives me an error:
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...