标签: windows-10-sdk

Devops:错误 CS0234:命名空间“Windows”中不存在类型或命名空间名称“ApplicationModel”

我正在尝试为 Windows 通用示例应用程序文件访问项目设置构建管道。

管道使用 Azure Pipelines Hosted VS2017 Image

当我在本地 VS 中运行它时,该解决方案就会构建。

Package.appxmanifest 包含

<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.17763.0" />
Run Code Online (Sandbox Code Playgroud)

当管道尝试构建时,构建任务日志中会出现以下错误。

Error CS0234: The type or namespace name 'ApplicationModel' 
does not exist in the namespace 'Windows' 
(are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)

YAML 是

resources:
- repo: self
queue:
  name: Hosted VS2017
  demands: 
  - msbuild
  - visualstudio

steps:
- task: NuGetCommand@2
  displayName: 'NuGet restore'


- task: VSBuild@1
  displayName: 'Build solution **\*.sln'
Run Code Online (Sandbox Code Playgroud)

该项目在我的机器上看起来像这样

项目参考

在哪里 一个参考

Microsoft.UI.Xaml.Markup

它运行正确。

我注意到 Nuget Restore 任务的日志没有错误并且确实报告了

2018-12-16T01:27:31.8700773Z …
Run Code Online (Sandbox Code Playgroud)

uwp azure-devops windows-10-sdk

6
推荐指数
1
解决办法
3169
查看次数

No references were found in the windows sdk (Windows 1903)

I want to create simple toast notification to action center in windows 10 from a WPF app using this article.

But I got problem on Step 2:

Right click on the project => Add => Reference... => Windows => Core

在此处输入图片说明

What I checked:

  • Windows 10 SDK Installation: 在此处输入图片说明
  • Same issue with a WPF project

And this is my csproj file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' …
Run Code Online (Sandbox Code Playgroud)

c# console-application visual-studio windows-10-sdk

5
推荐指数
3
解决办法
856
查看次数