无法导入 Visual Studio 2019 Scoped Credential [英] Visual Studio 2019 Scoped Credential could not be imported

查看:46
本文介绍了无法导入 Visual Studio 2019 Scoped Credential的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试发布我的数据库项目时出现以下错误:

I get the following error when I try to publish my database project:

无法导入数据库范围凭据,但您的源中存在一个或多个这些对象.

Database Scoped Credential could not be imported but one or more of these objects exist in your source.

有趣的部分是,如果我尝试在 Visual Studio 2017 中发布完全相同的项目,那么它可以工作,但 2019 会引发该错误.有谁知道为什么以及如何解决?

The interesting part is that If I try to publish the exact same project in Visual Studio 2017 then it works, but 2019 throws that error. Does anyone know why and how to fix?

我也尝试过在 2019 年创建一个新项目并复制我的旧文件,但它不起作用.发生同样的错误.我什至尝试没有我的旧代码,只有一个名为 Test 的表,但它仍然给出相同的错误.

I have also tried creating a new project in 2019 and copying my old files and it does not works. Same error occurs. I even tried having none of my old code and just one table called Test and it still gives the same error.

来自 .csproj 文件:

From .csproj File:

<PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
    <SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
    <VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>

编辑 3:

所以我意识到我的视觉工作室有更新.之后我的部署开始工作,但是我的部署后脚本不再运行.我想知道 Visual Studio 2019 是否改变了他们的工作方式?目前我在 Scripts/Script.PostDeployment.sql

So I realized that my visual studio had an update. After which I did the deployment started working, however my post-deployment script no longer runs. I'm wondering if with visual studio 2019 they changed how they work? Currentely I have a file in Scripts/Script.PostDeployment.sql

将文件重命名为 PostDeployment1 似乎可以解决问题.

Renaming the file to PostDeployment1 seems to fix the issue.

推荐答案

我通过右键单击安全性"解决了这个错误添加 >新项目... >凭据"

I resolved this error by right-clicking on "Security > Add > New Item... > Credential"

这篇关于无法导入 Visual Studio 2019 Scoped Credential的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆