Browse Source

Assume using the WebSDK means ASP.NET Core (#302)

- Ran into a strange case where some properties weren't being set (need to see if that means the right targets aren't running on the first pass). This was in a 2.1 application.
pull/305/head
David Fowler 7 years ago
committed by GitHub
parent
commit
aa3662b464
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/Microsoft.Tye.Core/ProjectReader.cs

10
src/Microsoft.Tye.Core/ProjectReader.cs

@ -228,9 +228,17 @@ namespace Microsoft.Tye
project.Frameworks.AddRange(sharedFrameworks.Select(s => new Framework(s)));
output.WriteDebugLine($"Found shared frameworks: {string.Join(", ", sharedFrameworks)}");
bool PropertyIsTrue(string property)
{
return projectInstance.GetPropertyValue(property) is string s && !string.IsNullOrEmpty(s) && bool.Parse(s);
}
project.IsAspNet = project.Frameworks.Any(f => f.Name == "Microsoft.AspNetCore.App") ||
projectInstance.GetPropertyValue("MicrosoftNETPlatformLibrary") == "Microsoft.AspNetCore.App" ||
projectInstance.GetPropertyValue("_AspNetCoreAppSharedFxIsEnabled") is string s && !string.IsNullOrEmpty(s) && bool.Parse(s);
PropertyIsTrue("_AspNetCoreAppSharedFxIsEnabled") ||
PropertyIsTrue("UsingMicrosoftNETSdkWeb");
output.WriteDebugLine($"IsAspNet={project.IsAspNet}");
output.WriteDebugLine($"Evaluation Took: {sw.Elapsed.TotalMilliseconds}ms");

Loading…
Cancel
Save