-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET 8: Enable build and run of project with arbitrary TFM #11613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It would be nice if one can say |
Ya, what Jan is talk to is really even more clearly articulating what I'm after. There are really two scenarios, ordered in (my) priority order:
These two experiences are not mutually exclusive. In terms of Jan's actual suggestions, I prefer the absence of |
What if you had an app that compiled against a fixed version of .NET Core (ie |
That is similar but not semantically the same. For example, imagine you have 3.1, 5.0 and 6.0 on the machine, and you want the app to run on 5.0. You can do that via global.json (with the proposed scheme) but not via TFM = 3.0 and the roll-forward knobs. The roll-forward knobs offer course-grained control, while the TFM offers fine-grained. The TFM does two things:
I'm obviously focused on the second one. The TFM is the only mechanism that has the level of control that I'm after. |
I noticed quite a few people complaining (esp on the asp.net core slack) that |
This isn't working for me either. D:\git\testapps\versioninfo>bin\Debug\netcoreapp3.0\versioninfo.exe --roll-forward=LatestMajor --
--roll-forward=LatestMajor
--
**.NET Core info**
Version: 3.1.2
FrameworkDescription: .NET Core 3.1.2
CoreCLR Build: 3.1.2-servicing.20066.2
CoreCLR Hash: fd22fd600a2526a7c58536da0e80325eb710d7f1
CoreFX Build: 3.1.2
CoreFX Hash: e946cebe43a510e8c6476bbc8185d1445df33a1a
**Environment info**
OSVersion: Microsoft Windows NT 6.2.9200.0
OSDescription: Microsoft Windows 10.0.19624
OSArchitecture: X64
ProcessorCount: 8 Same thing if I set the ENV. D:\git\testapps\versioninfo>set DOT
DOTNET_ROLL_FORWARD=LatestMajor /cc @vitek-karas |
The command line syntax doesn't use And the reason why it doesn't run on 5 is that 5 is pre-release and by default we don't roll forward from release to pre-release. (The reason is so that installing a pre-release version doesn't break existing apps ever). You can turn that off by setting: After that both the command line (See above without the |
Works. Thanks. I now remember discussing all these things. Thanks for your patience. The main issue still applies, after this little interlude. |
Related to: dotnet/runtime#71286 |
#38990 is a request to remove this error and instead make |
Uh oh!
There was an error while loading. Please reload this page.
I write a bunch of samples that I want to enable for developers to learn the product. TFMs are a limiting artifact when you want to enable a project to run on a newer runtime even though it targets an older one. I feel badly when I change the TFM solely to get to the app to run on a newer runtime.
App I am using: https://github.com/richlander/testapps/tree/master/versioninfo
In past, I used the
TargetFrameworks
approach, like the following:This is a pain, because
dotnet build
does the following:That's unacceptable as a default experience for samples, and only to enable a more advanced scenario.
Next approach is to configure the project for the min-support TFM and then mutate via the CLI:
I added the following code to the app to print arguments.
The approach with
/p:TargetFramework
seems to be generally working, but is failing for therun
case. The docs suggest that what I'm doing should be working.Can my preferred pattern be enabled? This:
dotnet run /p:TargetFramework=net5.0 --
. That'd be awesome.Not what I want, but I did discover that the following pattern works:
For clarity, I don't like this approach for two reasons:
On the one hand, the existing
dotnet build
support for my use case is satisfactory (super happy it works), but on the other, it seems the scenario is broken fordotnet run
whererun
andbuild
should have parity.So, I think this should be fixed. Thanks!
The text was updated successfully, but these errors were encountered: