找不到类型或名称空间AppServiceConnection [英] The type or namespace AppServiceConnection could not be found
问题描述
我在获取要在新计算机上编译的解决方案时遇到了麻烦.该解决方案包含一个与控制台应用程序打包在一起的UWP App.UWP应用通过
I am having trouble getting a solution to compile on a new computer. The solution contains a UWP App that gets packaged with a Console Application. The UWP app communicates with the Console Application via an AppServiceConnection. The UWP app is able to create an instance of the AppServiceConnection
class and compile just fine. However the console app seems unable to find anything related to the AppServiceConnection
class. It throws the following error:
The type or namespace AppServiceConnection could not be found
Looking at the References section of the Console Application, I noticed that there are a bunch of DLLs that cannot be found. Included in those is the Windows.Foundation.UniversalApiContract
DLL which contains AppServiceConnection
.
Looking at a coworkers computer which is correctly resolving these references, I learned that the DLLs were contained in the installation directory of .Net Framework C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1
When I inspect this directory on my own machine, I notice that I do not have this assembly.
Why is this missing on my machine even though our versions of .Net Framework are the same? Is there something I am forgetting to install?
Reference these two, and that's all.
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd
If you choose from the suggestion list, do not reference Windows.Foundation.UniversalApiContract.winmd
, reference Windows.winmd
.
这篇关于找不到类型或名称空间AppServiceConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!