dotnet / dotnet/msbuild

SSRS rptproj rdl files and assets are not copied to output directory when using /t:clean;build.

Open
#4,366 2 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Steps to reproduce
Ran into this issue using Azure Devops and narrowed it down to MSBuild. If I use the targets of `clean` and `build` the files and assets (images and what not) are not copied to the `OutputPath` but if I use `/t:build` it does copy the files. This reproduced with multiple different rptproj files including a brand new project created in Visual Studio 2019 (xml below).

Project file
```xml


Debug
bin\Debug
2
False
False
SSRS2016
Win32
NewReports
Datasets
Data Sources
Report Parts
http://localhost/reportserver


DebugLocal
bin\DebugLocal
2
False
False
SSRS2016
Win32
NewReports
Datasets
Data Sources
Report Parts
http://localhost/reportserver


Release
bin\Release
2
False
False
SSRS2016
Win32
NewReports
Datasets
Data Sources
Report Parts
http://localhost/reportserver


$base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL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JvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
@(DataSource)
@(DataSet)
@(Report)







```

MSBuild location: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin> `
(Some paths removed to protect sensitive information)
Working MSBuild command executed:
```
.\msbuild.exe "\NewReports.rptproj" /t:"Build" /p:platform="any cpu" /p:configuration="Release" /p:VisualStudioVersion="16.0"
```
Output:
```
Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/10/2019 12:39:19 PM.
Project "\NewReports.rptproj" on node 1 (Build target(s)).
ReportBuilderTarget:
Building the report, Certificate.rdl, for SQL Server 2016 Reporting Services.
Building the shared data source 'DataSource1.rds'.
Done Building Project "\NewReports.rptproj" (Build target(s)).

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.19
```
Not Working:
Working MSBuild command executed:
```
.\msbuild.exe "\NewReports.rptproj" /t:"Clean;Build" /p:platform="any cpu" /p:configuration="Release" /p:VisualStudioVersion="16.0"
```
Output:
```
Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/10/2019 12:37:16 PM.

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.14
```
### Expected behavior
RDLs built for designated version of SQL Reporting Server should be in the designated `OutputPath` for the configuration built.

### Actual behavior
No files are output to the `OutputPath`

### Environment data
`msbuild /version` output:
Locally: Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c for .NET Framework
Also reproduces on Azure Devops Pipelines
OS info:
Windows 10, Visual Studio 2019,
Azure Hosted 2017, Latest Visual Studio

Edited to add, in Azure Devops Pipeline I had to uncheck "clean" in the Visual Studio Build task to get it to work there.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.