Azure / Azure/Azure-Functions

Referencing Azure Functions Project (eg. Unit Testing) breaks dotnet CLI build.

Open
#1,643 3 comments 0 reactions 1 assignee Claimed by @v-bbalaiagar View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Not sure if this belongs here or under https://github.com/dotnet/sdk.

## Steps To Reproduce
1. Create an Azure Function empty project.
2. Create a class library project.
3. Create a MSTest project.
4. Add the class library as a project reference to the the azure function project.
5. Add the azure function project as a project reference to the MSTest project.
6. Build via dotnet build:
```sh
dotnet build UnitTestProject1\UnitTestProject1.csproj -c Release -o publish_output
```
## Expected Result
The build should succeed with no errors.

## Actual Result
```console
λ dotnet build UnitTestProject1\UnitTestProject1.csproj -c Release -o publish_output
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
All projects are up-to-date for restore.
ClassLibrary1 -> C:\Users\jtong\source\repos\Example\publish_output\ClassLibrary1.dll
FunctionApp1 -> C:\Users\jtong\source\repos\Example\publish_output\bin\FunctionApp1.dll
CSC : error CS0006: Metadata file 'C:\Users\jtong\source\repos\Example\publish_output\ClassLibrary1.dll' could not be found [C:\Users\jtong\source\repos\Example\UnitTestProject1\UnitTestProject1.csproj]

Build FAILED.

CSC : error CS0006: Metadata file 'C:\Users\jtong\source\repos\Example\publish_output\ClassLibrary1.dll' could not be found [C:\Users\jtong\source\repos\Example\UnitTestProject1\UnitTestProject1.csproj]
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:03.74
```

## Environment
Operating System: Windows 10 Enterprise 10.0.19041

```sh
dotnet --version
3.1.301
```

## Additional Details
The attached solution builds with `Microsoft Visual Studio Enterprise 2019 Version 16.6.2`. Building via the dotnet CLI without the `--output` parameter will succeed. Issue seems to just be with Azure Function projects. Reproduces on Windows and Ubuntu build VMs.

Related or Side Effect of? (https://github.com/Azure/Azure-Functions/issues/1643)

[build.zip](https://github.com/Azure/Azure-Functions/files/4848673/build.zip)
[Example.zip](https://github.com/Azure/Azure-Functions/files/4848674/Example.zip)

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.