-
Notifications
You must be signed in to change notification settings - Fork 217
Add os supported versions to host #4700
Add os supported versions to host #4700
Conversation
Also remove any manifest from apphost.exe as it will get the one from the app when it's used
@ericstj Any idea on how to test this? I thought about an app similar to your sample in the issue, but in order to validate it the test would somehow have to be able to determine the correct version of the OS it runs on - without any compatibility magic. Not sure if there's a way to do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for fixing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you test some set of apps with this change. Probably the built in apps plus the templates. We don’t want to break any of the basic scenarios and this does have that potential (due to turning off OS compatibility shims).
by built-in apps you mean all the "dotnet something" tools? |
Yeah, run dotnet tools. MSBuild is a good one, you could drop this version into a corefx repo and make sure it can still build, that'd be a nice test. For templates I was primarily thinking about dotnet new mvc, webapi, etc. Make sure none of those fall on the floor. WRT to an automated test: you can call RtlGetVersion and it won't lie. This is what we do in System.Runtime.InteropServices.RuntimeInformation, but in that case we only expose it as a string: So I imagine an automated test could fetch the current version from RtlGetVersion then ask VerifyVersionInfo to see if we're greater than or equal to that version. That'd have the nice characteristic of automatically failing when running on a new OS when we need to make a change. |
Added automated test for |
I verified this with the new dotnet.exe:
I manually exported and double checked the manifest embeded in the new dotnet.exe - it contains the original manifest plus the supported OSes. |
test OSX x64 Release Build |
Console.WriteLine(string.Join(Environment.NewLine, args)); | ||
Console.WriteLine($"Framework Version:{GetFrameworkVersionFromAppDomain()}"); | ||
|
||
#if WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need the #ifdef
? It looks like you only ever run this on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not needed, but I personally would prefer to keep it - makes it more explicit. I don't like code which doesn't run, but also doesn't work at all.
test OSX x64 Release Build |
1 similar comment
test OSX x64 Release Build |
This change is Windows only.
dotnet.exe
which specifies the supported OS versions.apphost.exe
as it should get the manifest from the app when it's customized.Fixes #3638