Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

aspnet core publish copies file even if it set to Do Not Copy

I set sqlite db file to not to be published by changing Copy to output directory to Do not copy. But it copies it still after publish and also the project changed to:

<None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />

is it a bug (I am running 5.0.2) or I misunderstand how publish works?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this:

<ItemGroup>
    <Content Update="app.db" CopyToPublishDirectory="Never" />
</ItemGroup>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...