c# - 在 VSTS 构建代理中构建解决方案时出现错误 CS0246
问题描述
我在 Visual Studio 2017 中创建了一个项目。它在本地完美构建,但是在尝试使用 VSTS 构建代理构建时,它给出以下警告 -
[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "StackExchange.Redis, Version=1.2.6.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
然后低于错误 -
[error]..\Utils\RedisService.cs(4,7): Error CS0246: The type or namespace name 'StackExchange' could not be found (are you missing a using directive or an assembly reference?)
2018-07-18T13:03:08.3934570Z Utils\RedisService.cs(4,7): error CS0246: The type or namespace name 'StackExchange' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\myProject.csproj]
2018-07-18T13:03:08.3938262Z ##[error]..\Utils\RedisService.cs(18,16): Error CS0246: The type or namespace name 'IDatabase' could not be found (are you missing a using directive or an assembly reference?)
2018-07-18T13:03:08.3939130Z Utils\RedisService.cs(18,16): error CS0246: The type or namespace name 'IDatabase' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\myProject.csproj]
目标框架是 4.7 ,并在构建任务中使用 nuget restore 版本 4.4.1 。
请提出一些解决方案,我检查了多个博客但没有得到帮助。
编辑 1 - 构建定义屏幕截图
解决方案
推荐阅读
- java - 如果出现 SQLException,insert 语句会发生什么?
- flutter - 在 TextField 小部件中从下方剪切文本:Flutter
- javascript - 无法在 IE 和 Edge 浏览器上从asset/test.xlsx 下载 excel 文件
- c# - 使用 Identity MVC C# 已经存在使用 Identity Username
- java - 从java中的文本文件中读取不同类型的变量
- python - 使用函数拆分数据帧并在 python 中单独调用数据帧时出错
- python - 使用功能及其内容的不同结果
- angular - 使用 .net 核心在 Angular 8 应用程序中直接下载带有 url 的文件,类似于带有应用程序 url 的 asp.net 文件路径
- wordpress - 带有自定义分类标签的 Wordpress 自定义帖子类型
- mongodb - 如何使用 MongoDB 和 Express.js 计算集合中的所有文档并在控制器中使用 cont?