简体   繁体   English

将SQL数据源添加到Web测试

[英]Add a SQL Datasource to a Web Test

I am trying to add a SQL Server Data Source to a Web Test in VS2017: 我正在尝试将SQL Server数据源添加到VS2017中的Web测试中:

在此处输入图片说明

I click Install packages and get this: 我单击“安装软件包”并获得以下信息:

Missing option value: installpath 缺少选项值:installpath

在此处输入图片说明

How do I overcome this problem? 我该如何克服这个问题?

Edit 1: 编辑1:

Using Process Monitor I have identified the command VS2017 runs: 通过使用进程监视器,我确定了VS2017运行的命令:

"C:\\program files (x86)\\microsoft visual studio\\installer\\vs_installer.exe" modify --focusedUi --installPath "" --activityId 6bb6d93d-8c2a-4462-9304-4ef2b29d27d1 --add Microsoft.VisualStudio.Component.SQL.DataSources --includeRecommended “ C:\\ program files(x86)\\ microsoft visual studio \\ installer \\ vs_installer.exe”修改--focusedUi --installPath“” --activityId 6bb6d93d-8c2a-4462-9304-4ef2b29d27d1 --add Microsoft.VisualStudio.Component。 SQL.DataSources --include推荐

The installPath is empty so I specified it as: installPath为空,因此我将其指定为:

"C:\\Program Files x86\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\" “ C:\\ Program Files x86 \\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ Common7 \\ IDE \\”

When I specify the installPath I get this error: 当我指定installPath时,出现此错误:

System.ArgumentException: The directory path 'C:\\Program Files x86\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE" --activityId 6bb6d93d-8c2a-4462-9304-4ef2b29d27d1 --add Microsoft.VisualStudio.Component.SQL.DataSources --includeRecommended' is invalid. Parameter name: installationPath System.ArgumentException:目录路径'C:\\ Program Files x86 \\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ Common7 \\ IDE“ --activityId 6bb6d93d-8c2a-4462-9304-4ef2b29d27d1-添加Microsoft.VisualStudio.Component.SQL。 DataSources --includeRecommended'无效。参数名称:installationPath

I guessed since its trying to install a Package it must be: 我猜因为它试图安装一个软件包,它必须是:

"C:\\Program Files x86\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\PACKAGES" “ C:\\ Program Files x86 \\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ Common7 \\ IDE \\ PACKAGES”

That results in this error: 导致此错误:

Unsupported option includeRecommended /finalizeinstall 不支持的选项包括建议/ finalizeinstall

在此处输入图片说明

What is the correct command? 正确的命令是什么?

Edit 2: 编辑2:

Confirming I already have the DataSources for SQ Server support installed: 确认我已经安装了SQ Server的数据源支持:

在此处输入图片说明

Edit 3: 编辑3:

Ok, this is my fault. 好的,这是我的错。

I run Visual Studio using a shortcut that uses a junction to avoid the brackets in the path C:\\Program Files (x86) in order to connect to an Oracle 9.2 database. 我使用快捷方式运行Visual Studio,该快捷方式使用联结来避免连接到Oracle 9.2数据库的路径C:\\Program Files (x86)中的括号。

Running Visual Studio (not from the shortcut) I see the dialog and can connect to the Database. 运行Visual Studio(不是通过快捷方式)我看到对话框并且可以连接到数据库。

在此处输入图片说明

However, when I click OK, no data source is added to the WebTest. 但是,当我单击“确定”时, 没有数据源添加到WebTest。

This is just a typical day using VS2017. 这只是使用VS2017的典型一天。 I swear this product has not been properly tested. 我发誓该产品尚未经过正确测试。

So I ran a Process Monitor trace when I clicked the OK button in the Data Connection Dialog and I found one Access Denied: 因此,当我单击“数据连接”对话框中的“确定”按钮时,我运行了一个进程监视器跟踪,发现一个访问被拒绝:

Event Class:    Registry
Operation:  RegCreateKey
Result: ACCESS DENIED
Path:   \REGISTRY\A\{A8BB3990-53C7-4BD7-A7E3-CFA0DD6BD4EC}\Software\Microsoft\VisualStudio\15.0_8708a912\Data Connection Dialog
TID:    11800
Duration:   0.0000764
Desired Access: Read/Write

I opened Visual Studios own Registry Hive ( using these steps ) and it turns out the Data Connection Dialog key didn't even exist. 我打开了Visual Studio自己的Registry Hive( 使用这些步骤 ),结果发现“数据连接对话框”键甚至不存在。 I created the Key, closed the registry, re-opened VS2017 and added a DataSource successfully: 我创建了密钥,关闭了注册表,重新打开了VS2017并成功添加了数据源:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM