dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.95k stars 4.9k forks source link

RelativePath in runtimeconfig.json #6207

Open genifycom opened 3 years ago

genifycom commented 3 years ago

Description

dotnet publish is indicating the following

publish: C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(617,5): error MSB4096: The item "C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\AWSBlazor.Client.runtimeconfig.json" in item list "AllPublishItemsFullPathWithTargetPath" does not define a value for metadata "RelativePath". In order to use this metadata, either qualify it by specifying %(AllPublishItemsFullPathWithTargetPath.RelativePath), or ensure that all items in this list define a value for this metadata. [C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\AWSBlazor.Client.csproj]

I cannot seem to find information on RelativePath in runtimeconfig.json or how to debug this issue.

Can anyone provide guidance?

Configuration

Regression?

Seems to have been a continuing problem

Other information

joperezr commented 3 years ago

thanks for logging the issue @genifycom. Could you share a binlog of your publish call so that we can better investigate what might be going on? To produce one, just run dotnet publish /bl from the command line. Or actually better yet, if you could provide a minimal repro project that would be even better.

no-response[bot] commented 3 years ago

This issue has been automatically closed due to no response from the original author. Please feel free to reopen it if you have more information that can help us investigate the issue further.

genifycom commented 3 years ago

I have more information on this issue.

Using DotNet Core SDK version (specified in global.json) { "sdk": { "version": "5.0.202" } }

I get the following:

Processing CloudFormation resource AspNetCoreFunction Initiate packaging of . for resource AspNetCoreFunction Building Docker image for C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp. Creating image tag from project: awsblazorserverapp Executing publish command Deleted previous publish folder ... invoking 'dotnet publish', working folder 'C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp../bin/Release/net5.0/linux-x64/publish' ... dotnet publish "C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp." --output "C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp../bin/Release/net5.0/linux-x64/publish" --configuration "Release" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained false ... publish: Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET ... publish: Copyright (C) Microsoft Corporation. All rights reserved. ... publish: Determining projects to restore... ... publish: Restored C:\Dev\Projects\AWSBlazor\AWSBlazor\Shared\AWSBlazor.Shared.csproj (in 89 ms). ... publish: Restored C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp\AWSBlazorServerApp.csproj (in 200 ms). ... publish: Restored C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\AWSBlazor.Client.csproj (in 199 ms). ... publish: AWSBlazor.Shared -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Shared\bin\Release\net5.0\AWSBlazor.Shared.dll ... publish: AWSBlazor.Client -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\AWSBlazor.Client.dll ... publish: AWSBlazor.Client (Blazor output) -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\wwwroot ... publish: AWSBlazorServerApp -> C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp\bin\Release\net5.0\linux-x64\AWSBlazorServerApp.dll ... publish: C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(617,5): error MSB4096: The item "C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\AWSBlazor.Client.runtimeconfig.json" in item list "AllPublishItemsFullPathWithTargetPath" does not define a value for metadata "RelativePath". In order to use this metadata, either qualify it by specifying %(AllPublishItemsFullPathWithTargetPath.RelativePath), or ensure that all items in this list define a value for this metadata. [C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\AWSBlazor.Client.csproj] Error executing "dotnet publish"

Using SDK version 101 I get a different error

Processing CloudFormation resource AspNetCoreFunction Initiate packaging of . for resource AspNetCoreFunction Building Docker image for C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp. Creating image tag from project: awsblazorserverapp Executing publish command Deleted previous publish folder ... invoking 'dotnet publish', working folder 'C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp../bin/Release/net5.0/linux-x64/publish' ... dotnet publish "C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp." --output "C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp../bin/Release/net5.0/linux-x64/publish" --configuration "Release" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained false ... publish: Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET ... publish: Copyright (C) Microsoft Corporation. All rights reserved. ... publish: Determining projects to restore... ... publish: All projects are up-to-date for restore. ... publish: AWSBlazor.Shared -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Shared\bin\Release\net5.0\AWSBlazor.Shared.dll ... publish: AWSBlazor.Client -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\AWSBlazor.Client.dll ... publish: AWSBlazor.Client (Blazor output) -> C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\bin\Release\net5.0\wwwroot ... publish: AWSBlazorServerApp -> C:\Dev\Projects\AWSBlazor\AWSBlazor\AWSBlazorServerApp\bin\Release\net5.0\linux-x64\AWSBlazorServerApp.dll ... publish: C:\Program Files\dotnet\sdk\5.0.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(143,5): error NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. [C:\Dev\Projects\AWSBlazor\AWSBlazor\Client\AWSBlazor.Client.csproj] Error executing "dotnet publish" AWSBlazor.zip