wpf icon indicating copy to clipboard operation
wpf copied to clipboard

The app is not compatible

Open JamesBlack2 opened this issue 7 years ago • 38 comments

我使用VS2019新建了一个测试用的.net core的控制台应用程序,但是当我把这程序发布后生成的文件复制到Win7 service 1,7061的 32位系统想远行时,却提示文件版本与系统不兼容,就是将其设置兼容性再跑时,也不行。是否VS2019预览版并没有完全将.net core的运行打包在一起?

下面是app的项目配置。 《Project Sdk="Microsoft.NET.Sdk"> 《 PropertyGroup> 《 OutputType>Exe《/OutputType> 《 TargetFramework>netcoreapp2.2《/TargetFramework> 《/PropertyGroup> 《/Project>

JamesBlack2 avatar Dec 06 '18 12:12 JamesBlack2

You need to install the dotnet core runtime in win7.

你需要在 Win7 的系统上安装 运行时。

Or you can publish the dotnet core application to win7 x86.

或者将 dotnet core 程序发布为 Win7 x86 然后复制到 win7 运行

lindexi avatar Dec 06 '18 12:12 lindexi

有两个问题: 1) 2>正在还原 H:\Test\WpfApp6\WpfApp6\WpfApp6.csproj 的包...

这个步骤不动了,我是发布到本地的目录上的,这个应该不需要这么久的时间吧。这个步骤在我这至少花了好几分钟。不过后面几次很快,这个我测试了几个工程,第一次都需要好几分钟时间。

2)在那个控制台应用程序,通过发布独立的,是可以正常跑,但是如果是WPF的话,则一打开就会崩溃跑不起来。

WPF的项目配置如下: 《Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> 《PropertyGroup> 《OutputType>WinExe 《TargetFramework>netcoreapp3.0 《UseWPF>true 《AssemblyName>MyCore3App《/AssemblyName> 《Platforms>AnyCPU;x64;x86《/Platforms> 《/PropertyGroup> 《/Project>

JamesBlack2 avatar Dec 06 '18 13:12 JamesBlack2

In general, we take feedback and questions only in English. If it still needs a response, can someone please post English translations? (automated are mostly fine) We can then update the original posts with appropriate text.

Thank you!

karelz avatar Dec 06 '18 18:12 karelz

There two questions:

1:

           2 > Restoring packages of H: \Test\WpfApp6\WpfApp6. csproj...

In this step, I publish it to the local directory, which took me at least a few minutes. I tested several projects, all of then are took several minutes to compile the first time. It's just a small project. would bigger projects take longer?

2:In that console application, it can be run normally. but if it is WPF project, it will crashes at the start to run.

JamesBlack2 avatar Dec 07 '18 03:12 JamesBlack2

@JamesBlack2 It would be helpful if you could upload a sample project to a GitHub repository and then share that repository with us here. Then we can examine the exact code that you are having issues with.

rladuca avatar Dec 07 '18 04:12 rladuca

Thanks,i has update the sample project to github now. https://github.com/JamesBlack2/WpfApp6.git

JamesBlack2 avatar Dec 07 '18 06:12 JamesBlack2

@JamesBlack2 I think you build the application in the win10 and run in win7.

lindexi avatar Dec 07 '18 06:12 lindexi

It is,build in Win10 and run in Win7.it must be build in Win7 if i want it run in win7 or other win version? I saw that guide like that,and build to try run,the result is the same too.the project is make by command "dotnet new wpf -o WalterlvWpfApp"

JamesBlack2 avatar Dec 07 '18 08:12 JamesBlack2

我使用VS2019新建了一个测试用的.net core的控制台应用程序,但是当我把这程序发布后生成的文件复制到Win7 service 1,7061的 32位系统想远行时,却提示文件版本与系统不兼容,就是将其设置兼容性再跑时,也不行。是否VS2019预览版并没有完全将.net core的运行打包在一起?

下面是app的项目配置。 《Project Sdk="Microsoft.NET.Sdk"> 《 PropertyGroup> 《 OutputType>Exe《/OutputType> 《 TargetFramework>netcoreapp2.2《/TargetFramework> 《/PropertyGroup> 《/Project>

I used VS2019 to create a .Net Core console app for testing: when I put the files built to Windows7 Service 1,7061 32bits, it prompts that the file version is incompatible with the system. Nor would it work if I turn on the compatibility mode. Does it mean that VS2019 Preview doesn't bundle the .Net Core runtime?

@karelz here you are.

shadowaltar avatar Dec 07 '18 10:12 shadowaltar

I also encountered this problem. Created a wpf program based on .net core3.0, which can run normally on this machine and other WIN10 machines, but it can't run under WIN7 (x64 and x86 try, the result is the same). Also try to install the .netcore3.0 runtime on the WIN7 machine, the result is still the same, the WPF window does not display and an error window pops up. After the x86 app has replaced some of the api-ms-win-core-xxxx.dll, the WPF window is displayed, but the error window pops up, and the program exits after clicking.

boyjiwen avatar Dec 07 '18 10:12 boyjiwen

我在win 7上使用 .net core3.0 发布wpf 工程,也遇到这个问题。

randyliang1 avatar Dec 07 '18 10:12 randyliang1

Me too, I created the .net core 3.0 program under win7, but it can't run. Is it that some of my configurations are wrong?

LiangWeixin avatar Dec 07 '18 10:12 LiangWeixin

is you build you project in win7 ,and you run system has setup .netcore runtime? @lindexi

JamesBlack2 avatar Dec 07 '18 12:12 JamesBlack2

@randyliang1 @LiangWeixin I can run it in win7 sp1

image

See 如何创建一个基于 .NET Core 3 的 WPF 项目 - walterlv

将基于 .NET Framework 的 WPF 项目迁移到基于 .NET Core 3 - walterlv

Is the running environment locally installed with VS2019 or net core3 sdk? After I compile the WIN7 device, the local can run normally, and I can't run it on another WIN7 machine without a development environment.

image

boyjiwen avatar Dec 07 '18 13:12 boyjiwen

@lindexi Your program seems to be a system loaded with a runtime. Whether vs2019 can put the dependent runtime into the application, not the system's runtime.

boyjiwen avatar Dec 07 '18 13:12 boyjiwen

  1. dotnet new wpf -o wpfapp

  2. publish image

  3. Tested in different systems (no .netcore runtime installed) WIN10: OK image

WIN7 64 : ERROR image

boyjiwen avatar Dec 07 '18 15:12 boyjiwen

I can't tell what the actual error you're experiencing is. However, WPF for .NET Core currently has a dependency on the VCRuntime (See the getting started guide and #37). The fact that various machine are behaving this way with a previously published application seems to be indicative of running into this requirement.

If you can verify that your issues are spawned from the same (or similar) issue and that installing VCRuntime on all machines that you want to run your application on solves the issue we can close this as a duplicate of #37. We are already working to address that specific issue.

rladuca avatar Dec 07 '18 16:12 rladuca

@rladuca After installing VCRuntime x86 and x64 (Microsoft Visual C++ Redistributable for Visual Studio 2017) on the WIN7 machine, the problem still exists.

image

Please advise how can I find my program error? Have tools?

My requirement is that the program can run under a machine that does not have the .netcore runtime installed.

Also, will the final version support Windows XP? When is the final version plan released?

boyjiwen avatar Dec 07 '18 16:12 boyjiwen