dotnet / dotnet/msbuild

Adding webjobs-list.json to project causes problems with resx resources in /t:package mode

Open
#3,934 3 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

### Brief description
MSBuild doesn’t seem to work properly for web application with both: external resource project and WebJob list. Language folders in ./bin directory are missing.

### Use case
Within a project I have couple web applications. Each of them is available in multiple languages. Since most of strings are used in multiple web apps, I decided to create a separate project with resx resource files only. One of these web applications utilizes WebJobs to perform some background tasks. WebJobs are build and deployed along with this web app thanks to webjobs-list.json mechanism.
To deploy the application to Azure, I would like to build an artifact using MSBuild.exe with /t:package parameter.

### Steps to reproduce
1. Create new .NET Framework web application
2. Create new project with resource files in multiple languages
3. Create new WebJob project (console app)
4. Create a reference in web app to resource project and Microsoft.Web.WebJobs.Publish 2.0.0
-- at this point MSBuild correctly creates language folders in ./bin directory
5. Add webjobs-list.json to Properties of web application
6. Run MSBuild.exe with /t:package (the problem doesn’t occur when I run MSBuild.exe without /t:package parameter)

### Expected behavior
MSBuild should create language folders in ./bin directory.

### Actual behavior
Language folders in ./bin directory are missing.
Deleting webjobs-list.json and re-running MSBuild fixes the language folder problem, but then WebJob is not attached to web app.

### Environment data
`msbuild /version` output: 15.9.20.62856 (I tested on 15.8.169.51996 as well)
Visual Studio builds and deploys the web application properly.

### Sample project
Below you can find sample project to reproduce the issue. Language folders in ./bin directory are created properly until you add webjobs-list.json (included in .zip) to ./WebApplication/Properties.
[WebApplication.zip](https://github.com/Microsoft/msbuild/files/2589120/WebApplication.zip)
Script I use to build an artifact:
`MSBuild.exe ".\WebApplication\WebApplication.csproj" /p:OutputPath="./Publish/" /p:Configuration=Release;platform="Any CPU" /v:m /m /nr:false /p:RunCodeAnalysis=False`

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.