corert icon indicating copy to clipboard operation
corert copied to clipboard

Publish broken when DisableImplicitFrameworkReferences set

Open kant2002 opened this issue 5 years ago • 2 comments
trafficstars

I have 2 projects both of which configured in similar fashion

Runtime

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <RuntimeMetadataVersion>v4.0.30319</RuntimeMetadataVersion>
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
  </PropertyGroup>

App

<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

    <NoStdLib>true</NoStdLib>
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
    <NoConfig>true</NoConfig>
    <RuntimeMetadataVersion>v4.0.30319</RuntimeMetadataVersion>
    <IlcSystemModule>Runtime</IlcSystemModule>
  </PropertyGroup>

This does not work on clean build. and start complaining that could not copy "App.exe" to bin/ location.

I use DisableImplicitFrameworkReferences to not have standard libraries attached to my CSC compilation process, since I use custom runtime.

I'm not sure is this CoreRT tooling, or regular .NET SDK tooling issue.

kant2002 avatar Mar 09 '20 13:03 kant2002

That looks like .NET SDK issue. You need to find the place that is trying to copy app.exe to bin in the .NET SDK targets and suppress it somehow.

jkotas avatar Mar 09 '20 15:03 jkotas

I manage the make it work, but adding following lines:

<SelfContained>false</SelfContained>
<UseAppHost>false</UseAppHost>

And adding

<ItemGroup>
    <LinkerArg Include="/subsystem:console /entry:__managed__Main /merge:.modules=.rdata /merge:.pdata=.rdata /DYNAMICBASE:NO /filealign:16 /align:16" />
  </ItemGroup>

Questions:

  • Should I document this somewhere in this repo?
  • Can first part be part of .NET SDK ?
    • If so which report should I file issue.
  • Can this be part of CoreRT tooling?

kant2002 avatar Mar 14 '20 13:03 kant2002