You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there anything particular to take into consideration when building with .Net Core 5 SDK? I have a cake build script that runs just fine locally, but fails on our TeamCity build-server. The error we get is: error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false.
If I do as suggested and specify a valid RID I get another error: error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead.
All the projects in said solution contain the following element:
var taskBuildBackEnd = Task("BuildBackEnd")
.Does(() => {
InBlock("Building NOA Back-End", () => {
foreach(var solution in solutions)
{
Information("Building {0} for .Net Core runtime: {1}", solution, runtime);
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration,
Verbosity = msBuildVerbosity,
MSBuildSettings = new DotNetCoreMSBuildSettings()
};
if (selfcontained) {
settings.MSBuildSettings.WithProperty("useapphost", "true");
settings.MSBuildSettings.SetRuntime(runtime);
}
DotNetCoreBuild(solution.ToString(), settings);
}
});
});
var taskPublishBackEnd = Task("PublishBackEnd")
.Does(() => {
InBlock("Publishing NOA Back-End", () => {
CleanDirectory(paths.OutputDir);
foreach(var solution in solutions)
{
Information("The target .Net Core runtime is: {0} with the selfcontained flag set to {1}", runtime, selfcontained);
var settings = new DotNetCorePublishSettings
{
Configuration = configuration,
SelfContained = selfcontained,
Runtime = runtime,
OutputDirectory = paths.OutputDir,
Verbosity = msBuildVerbosity,
MSBuildSettings = new DotNetCoreMSBuildSettings().WithProperty("CopyLocalLockFileAssemblies", "true")
};
if (selfcontained)
{
settings.MSBuildSettings.WithProperty("useapphost", "true");
settings.MSBuildSettings.SetRuntime(runtime);
}
DotNetCorePublish(solution.ToString(), settings);
}
});
});
So this is looking like a Catch-22 situation. Before installing the 5.0 SDK on the build server, this cake script ran without a hitch (no element then). However, adding/removing the element makes no difference with the 5.0 SDK. Cake version: 0.38.5. My colleagues and I are completelly dumbfounded by this, so any help/pointers in the right direction would be highly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there anything particular to take into consideration when building with .Net Core 5 SDK? I have a cake build script that runs just fine locally, but fails on our TeamCity build-server. The error we get is: error
NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false.
If I do as suggested and specify a valid RID I get another error:
error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead.
All the projects in said solution contain the following element:
Tasks:
So this is looking like a Catch-22 situation. Before installing the 5.0 SDK on the build server, this cake script ran without a hitch (no element then). However, adding/removing the element makes no difference with the 5.0 SDK. Cake version: 0.38.5. My colleagues and I are completelly dumbfounded by this, so any help/pointers in the right direction would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions