Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Directory.build.props no longer creating separate local and container folders within bin after migrating to aspnetcore 3.1

$
0
0

I have an application consisting of 3 projects: App.Application, App.Domain, App.Infrastructure. App.Application is netcoreapp3.1, and the other two are netstandard2.1.

In the App.Application project folder, i have the following Directory.build.props file:

<Project>
    <PropertyGroup>
        <DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/obj/**/*</DefaultItemExcludes>
        <DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/bin/**/*</DefaultItemExcludes>
    </PropertyGroup>
    <PropertyGroup Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'">
        <BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/container/</BaseIntermediateOutputPath>
        <BaseOutputPath>$(MSBuildProjectDirectory)/bin/container/</BaseOutputPath>
    </PropertyGroup>
    <PropertyGroup Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' != 'true'">
        <BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/local/</BaseIntermediateOutputPath>
        <BaseOutputPath>$(MSBuildProjectDirectory)/bin/local/</BaseOutputPath>
    </PropertyGroup>
</Project>

I added that file as a part of my docker development setup. When I ran the setup, a container executing dotnet watch, the build process inside the container created a /container folder inside the bin folder of Application.app. This way there were no read/write conflicts between docker and my local file system (I run Ubuntu 19.10).

I did the above when I ran ASP.NET Core at version 2.2. Now, after I have upgraded to 3.1, the steps laid out in Directory.build.props are ignored. Meaning, the build process, local or inside container, builds to the following directory structure:

bin
└── Debug
    └── netcoreapp3.1
        ├── Properties
        └── runtimes

I'm guessing this has something to do with the upgrade of ASP.NET Core to v3.1, however, it may be that by mistake i have changed something that caused this problem.

The problem is that I'm experiencing some various errors now in visual studio code when I attempt to run my docker container. I have several other netstandard2.1 projects located in another folder, which are being referenced by App.Application. VS Code tells me that the "types or namespaces cannot be found". The dotnet watch command inside the container builds fine and executes fine however, and I can access the app in my browser.

Does anyone know how to either adapt my current Directory.build.props file, or take another approach, to make this work?


Viewing all articles
Browse latest Browse all 97327

Trending Articles