Open En3Tho opened 5 days ago
I've fixed this by adding to the Directory.Build.props
but as I said it is not ideal. Is there a way for AppHost to get this value automatically?
<SolutionName Condition=" '$(SolutionName)' == ''">MyApp</SolutionName>
@joperezr @eerhardt can one of you take a look?
@En3Tho, the easiest way for us to investigate is if you can provide a repro project that reproduces the behavior. This can either be a .zip file or a link to a github repo. Is that possible?
@eerhardt The issue turned out to be slightly trickier (the build/run part)
Create new aspire-starter application
dotnet new aspire-starter -o "AspireApp"
cd .\AspireApp\
Create Directory.Build.props file
dotnet new buildprops
Copy the following into Directory.Build.props:
<Project>
<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts\$(SolutionName)</ArtifactsPath>
</PropertyGroup>
</Project>
Run restore/build
dotnet restore
dotnet build
Now here is tricky part:
artifacts\AspireApp\bin|obj
folder should appear when dotnet restore/build
is executed from folder with a solution file. This is a correct location for generated artifacts.SolutionName
and bin|obj
are created in \artifacts
. This is not a correct location.dotnet run
/ dotnet run --project
creating files in incorrect location but app actually runs.
Recently I've been migrating my personal projects to use artifacts output with my custom provided path:
Here is what I've added to my
Directory.Build.props
:When build is done artifacts are published to folder I've chosen in
ARTIFACTS_PATH_DOTNET
env variable for example:ARTIFACTS_PATH_DOTNET\MySolution\bin\MyApp\debug
- this is expectedBut when I start app host it seems to miss
SolutionName
and start process like this and fails:'ARTIFACTS_PATH_DOTNET\bin\MyApp\debug\MyApp.exe'
What can I do to fix this? I can obviosuly replace
$(SolutionName)
with a concrete one but it is not ideal I guess.