dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.89k stars 4.89k forks source link

WinPE support #571

Closed madhav5589 closed 7 years ago

madhav5589 commented 7 years ago

Hello,

I have an windows application running on .NET 4.5.1 version. I am planning to migrate APIs to .NET core. Wonder if .NET core has any plan to support WinPE (Windows Pre-installed Environment) platform. I looked at the potential road map section but couldn't find anything specific to WInPE platform support.

Thanks.

Petermarcu commented 7 years ago

WinPE hasn't been something we've considered for the project but if you want to try running .NET Core under WinPE it may work. It would be limited by all the limitations of WinPE but I don't know of a reason off the top of my head why a basic application wouldn't be able to run. What are you trying to do with it that needs to work in WinPE?

madhav5589 commented 7 years ago

@Petermarcu I have an windows application (using .NET 4.6) which I use to run in WInPE environment for Imaging purpose (using Ghost for Windows platform). Now, I want to support Linux platform as well and I guess .NET core would support cross platform.

Petermarcu commented 7 years ago

I would suggest creating a self contained .NET Core application and use it where you use your .NET 4.6 app. Yes, if you want to run .NET on Linux, .NET Core is a great path to that.

madhav5589 commented 7 years ago

@Petermarcu Thanks. I followed the doc from here for simple SCD console application. After publishing the app, when I try to run the published app.dll inside WinPE, it shows an error that

dotnet is not recognized as internal or external command

in the command prompt. I thought that SCD project contains the .net core library files and dependent dll files with it. Any thoughts?

mellinoe commented 7 years ago

@madhav5589 If you have a self-contained deployment, then you don't need to invoke it with dotnet. You should have an actual executable file ("myappname.exe") in the published output that you can run directly.

madhav5589 commented 7 years ago

@mellinoe I was using <OutputType>Exe</OutputType> in the project file with RunTimeIdentifier as "Any". Since I am trying to run it in WinPE, is there specific RID dedicated for that? RID catalog reference: click here

mellinoe commented 7 years ago

@madhav5589 Disclaimer: I don't know much about WinPE, and as far as I know it's an untested scenario.

I was using Exe in the project file with RunTimeIdentifier as "Any".

If you are using a self-contained deployment (which I think makes sense in this case), then you need to choose a specific, concrete RID. In this case, I would try "win7-x64". The output of this should include coreclr.dll, "myapp.dll", and "myapp.exe", as well as a bunch of other miscellaneous files.

MrM40 commented 5 years ago

madhav5589, did you succeed running dotnet in WinPE?

madhav5589 commented 5 years ago

@MrM40 Yes, I could run .NET core console app in WinPE environment. But not WPF app. I installed .NET core 3.0 preview version and created a sample WPF app using default template and published it using Self Contained Deployment. Couldn't run it in WinPE environment. It throws "an unknown software exception". @Petermarcu @mellinoe Any thoughts on this?

karelz commented 5 years ago

@madhav5589 WinPE is specific OS setup, which does not contain all components, so I would not be surprised if some parts of .NET Core or WPF/WinForms won't work. Supporting WinPE for WPF is not on our backlog AFAIK. BTW: Neither Peter nor Eric are on our team anymore ...

madhav5589 commented 5 years ago

@karelz Thanks for the update. It makes sense now to me.