首页 > 解决方案 > MSBuild 无法部署到 localhost ReportServer

问题描述

我正在尝试将具有两个 rptproj 项目的解决方案部署到本地 SSRS ReportServer:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" \ 
"C:\Users\Documents\Reports\Reports.sln" /target:Deploy /p:TargetServerUrl=http://localhost/ReportServer /p:configuration="Release" /p:Username="MYSERVER\ReportDeployer" /p:Password=sOmepAsSwoRD

rdl 文件的构建成功,但是当它尝试部署时,它几乎立即失败并显示以下消息:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Reporting Services\Microsoft.ReportingServices.MS
Builder.targets(30,5): error :  : Could not connect to the report server http://localhost/ReportServer. Verify that t
he TargetServerURL is valid and that you have the correct permissions to connect to the report server.

我已经验证 ReportServer 正在运行,并且我可以使用我在 /p:Username 和 /p:Password 中提供的凭据访问它,并且用户对 ReportServer 上的根文件夹具有所有权限。报告已经从 Visual Studio 发布了很多次 - VS 只显示凭据的弹出窗口,然后它就成功了。

我还尝试了 wget,它成功通过了身份验证并加载了 ReportServer 页面:

wget http://localhost/ReportServer --user "MYSERVER\ReportDeployer" --password sOmepAsSwoRD

--2019-03-22 23:11:19--  http://localhost/ReportServer
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm="localhost"
Reusing existing connection to [localhost]:80.
HTTP request sent, awaiting response... 200 OK
Length: 574 [text/html]
Saving to: 'ReportServer.1'

ReportServer.1                100%[===================================================>]     574  --.-KB/s   in 0s

2019-03-22 23:11:19 (11.4 MB/s) - 'ReportServer.1' saved [574/574]

MSBuild 有什么问题?如何使其与本地 ReportServer 一起使用?

我也试过 devenv.com 命令行

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.com" "C:\Users\Documents\Reports\Reports.sln" /deploy

希望它会显示更详细的错误信息。但它似乎忽略了部署命令和输出:

------ Build started: Project: Reports, Configuration: Release ------
Build Build complete
...

------ Skipped Deploy: Project: Reports, Configuration: Release ------
Project not selected to build for this solution configuration
========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 2 skipped ==========

为什么它说“构建开始”,而如果我在 Visual Studio 中运行部署它输出“部署开始”并确实部署了项目?

那么如何自动化 SSRS 项目部署呢?

标签: reporting-servicesdeploymentmsbuild

解决方案


推荐阅读