aspnet / MusicStore

[Archived] MusicStore test application that uses ASP.NET/EF Core. Project moved to https://github.com/aspnet/AspNetCore
1.3k stars 878 forks source link

Does not compile in Linux #692

Closed DonSchenck closed 8 years ago

DonSchenck commented 8 years ago

When running dotnet build --framework netcoreapp1.0 in Linux, the following errors are thrown:

/MusicStore/src/MusicStore/Platform.cs(32,59): error CS1061: 'PlatformServices' does not contain a definition for 'Runtime' and no extension method 'Runtime' accepting a first argument of type 'PlatformServices' could be found (are you missing a using directive or an assembly reference?)

/MusicStore/src/MusicStore/Platform.cs(47,50): error CS1061: 'PlatformServices' does not contain a definition for 'Runtime' and no extension method 'Runtime' accepting a first argument of type 'PlatformServices' could be found (are you missing a using directive or an assembly reference?)

/MusicStore/src/MusicStore/Platform.cs(62,74): error CS1061: 'PlatformServices' does not contain a definition for 'Runtime' and no extension method 'Runtime' accepting a first argument of type 'PlatformServices' could be found (are you missing a using directive or an assembly reference?)

/MusicStore/src/MusicStore/StartupOpenIdConnect.cs(132,32): error CS0103: The name 'OpenIdConnectResponseTypes' does not exist in the current context

/MusicStore/shared/Mocks/OpenIdConnect/TestOpenIdConnectEvents.cs(55,81): error CS0117: 'OpenIdConnectRequestType' does not contain a definition for 'LogoutRequest'

/MusicStore/shared/Mocks/StartupOpenIdConnectTesting.cs(120,32): error CS0103: The name 'OpenIdConnectResponseTypes' does not exist in the current context

Compilation failed.
    0 Warning(s)
    6 Error(s)
DonSchenck commented 8 years ago

Just tested; same error when compiling on Windows when --framework netcoreaapp1.0 is specified.

Apparently, the code to retrieve the underlying environment (Mono, Nano Server or Windows) does not work with netcoreapp1.0.

Perhaps switching to System.Runtime.InteropServices.RuntimeInformation.OSDescription.ToString() would be better?

I don't have access to Mono nor Nano Server; what does System.Runtime.InteropServices.RuntimeInformation.OSDescription.ToString() return in those cases?

BrennanConroy commented 8 years ago

Well the fact that you're getting PlatformServices errors tells me you're using an outdated Musicstore. Update it and try again.

DonSchenck commented 8 years ago

D'oh.

Thanks.