How to add Microsoft.NET.CoreRuntime.2.1 for UWP package installer?

寵の児 提交于 2019-12-11 01:32:19

问题


I have Xamarin Application. I can build ipa, APK and UWP(.appx) package. ipa and APK is working fine. I am facing issue while installing UWP.

Issue with UWP: It is asking to install Microsoft.NET.CoreRuntime.2.1 as it is one of the dependencies.

Do I need to add Microsoft.NET.CoreRuntime.2.1 in project? If so, where? Can anybody please suggest?

I gave created package with following steps

1: Right click UWP project-> Store-> Select create app packages

2: Now in debug mode we don't need to upload it to the store that's why I select No

3: Than I give path for output location. Give version and select generate app bundle as never and select x86 and x64 architecture as requirement

4: It generate package

After creating package, user need to install these Microsoft.NET.CoreRuntime.2.1 and Microsoft.VCLibs.x64.14.00 manually which is given in package folder.

Well, I think this is not ideal case where user need to install the dependencies manually. It should be there in project or it should be install automatically with package as per-requisite.

Let me tell you how we install it. I know there is option to install using PowerShell but I don't have thoroughly idea about it.

1- Certificate Installation - MyApp.UWP_1.0.0.0_x86/MyApp.UWP_1.0.0.0_x64.cer - Click on Install Certificate - Select store location as "Local Machine" - Click on Next - It gives you a alert about installation certificate press "Yes" - Than select place all certificate in following store - It enables below textbox with browse option click on browse and select "Trusted Root Certification Authorities" - Click on Next, Finish and Close

2- Install Dependencies - Open Dependencies --> x86/x64 folder - Install both files

3- Package Installation - Double click on "MyApp.appx"

Please guide me.


回答1:


The reason why you are asked to install the dependencies is that your UWP app have a dependency requirement for them but your current Device OS doesn't install these dependencies. If you install your app from the Microsoft Store, the Store will check your app requirments and automatically install the dependencies that your app need but are not installed.

For your issue, you are sideloading your UWP app, since there is no a process as Store to install the dependencies that your app need but are not installed in current device, so you will need to install the dependency manully.

Generally, you can find the dependencies in the Dependencies folder from the corresponding version package's folder (same file path as your appx file). You should install the corresponding dependencies base on your device and the your UWP App appx platform.

--- Update ---

If you want to install the app using PowerShell, you still need to install the dependencies. You can use the Add-AppxPackage cmdlet to add a signed app package to a user account and use the DependencyPath parameter to add all other packages that are required for the installation of the app package. See the topic Add-AppxPackage and the Example 1: Add an app package to install the app and dependencies.

PS C:\> Add-AppxPackage -Path "C:\Users\user1\Desktop\MyApp.appx" -DependencyPath "C:\Users\user1\Desktop\Microsoft.NET.CoreRuntime.2.1.appx"


来源:https://stackoverflow.com/questions/51931128/how-to-add-microsoft-net-coreruntime-2-1-for-uwp-package-installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!