Is PackageDependency for VCLibs in appxmanifest required? #4886
Replies: 3 comments
-
I am also not quite sure if it is a real requirement. At least it also works without it on first sight. To be able to install the app with the PackageDependency, you must first install the dependency package that you can find at |
Beta Was this translation helpful? Give feedback.
-
If you also notice, it also states that .NET 6 or later is required. From a .NET side, this may seem obvious, but this would imply that a C++ or other language application using the Windows App SDK would also require .NET. So it is always difficult to take these statements as is. Anyway, that isn't the issue here. When you are using Add-AppxPackage to install a package, you really should be using the command line options to specify the locations of the dependencies. Installing via Add-AppxPackage doesn't automatically query the store for dependencies so you have to supply them yourself. You can only get away with not supplying a dependency if it is already installed on that system. Also, the Windows App SDK itself is built with the "Hybrid CRT" build method. So it technically doesn't need the VC runtime. However, it is quite easy to use a package that isn't built this way. So it is possible to remove the reference if you are sure that nothing in your application will ever need the runtime, but you should be careful since without the VC runtime package, the application can look at the system version of the VC redistributable, and so everything will seemingly work correctly until one day where it just fails. |
Beta Was this translation helpful? Give feedback.
-
你可以在 wapproj 文件中设置 You can check whether this dependency is required by setting |
Beta Was this translation helpful? Give feedback.
-
In the "prerequisit" section of this doc Windows App SDK deployment guide for framework-dependent packaged apps, it states
In C++ Runtime framework packages for Desktop Bridge, it says to reference the VCLibs package, the following code should be added in
appxmanifest
file.However, with the above code, it seems my app package is no longer able to be installed:
Removing this line fixes the error. This issue also mentioned removing the line fixes the deployment error.
Also noticed that the app package does not seem to have any difference with or without the VCLibs PackageDependency in appxmanifest.
Does anyone know if this declaration in appxmanifest is required?
Beta Was this translation helpful? Give feedback.
All reactions