0

WixSharp を使用してインストーラーをビルドしています。私のプロジェクトでは、これがあります:

new Files(
    new Feature("RootFilesFeature"),
    Path.Combine(C_SERVICE_RELEASE_PATH,"*.*"),
    (lFilename) => !lFilename.StartsWith("appsettings", true)
)

その述語に関係なく、まだ appsettings.json と appsettings.development.json がインストールされています。

私は何を間違っていますか?

4

2 に答える 2

0

lFilenameパスを含むファイルの名前が原因だと思います。

あなたのケースで可能であれば、それを使用してくださいContains

new Files(
    new Feature("RootFilesFeature"),
    Path.Combine(C_SERVICE_RELEASE_PATH,"*.*"),
    (lFilename) => !lFilename.Contains("appsettings")
)

またEndsWith

new Files(new Feature("RootFilesFeature"),
    Path.Combine(C_SERVICE_RELEASE_PATH, "*.*"),
    (lFilename) => !lFilename.EndsWith("appsettings.json", true) || 
                   !lFilename.EndsWith("appsettings.development.json", true)
)
于 2021-01-22T13:02:26.653 に答える