2016-12-08 14 views
1

私はC#アプリケーションを継承しました。それは、私が「このタスクが上昇権限を持っているアプリケーションが必要です」というメッセージが表示取得UACxml変換をapp.manifestに適用する

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 

私はデバッグは、Visual Studio内でそれを構築するか、すべての時間を有効にapp.manifestだ中では、現在のエントリがあります。 (私は管理者アカウントを持っていますが、開発時にはログオンしません)

xml変換を適用する方法(web.configsなど)、またはリリースモードでapp.manifestを作成する方法はありますか?

答えて

1

SlowCheetah NuGetパッケージと付属の拡張機能を使用すると、web.configの場合と同じようにすべてのxmlファイルで同じ動作が得られます。

NuGetパッケージとVisual Studio Extensionをインストールしてアクティブにしてください。また、NuGetにはいくつかのSlow Cheetahバージョンがあります - Microsoft - Microsoft.VisualStudio.SlowCheetahによってリリースされた最新のものを使用することをお勧めします。 https://github.com/Microsoft/slow-cheetah

編集:私は実際に変換が私のSharePointのアドインプロジェクトのためにApp.Manifest.xmlのために働くために長い闘いを取得していた。この上

もっと読みます。 "Add transform"を使用するときに作成されたファイルは、含まれていないと変換が失敗する(結果が出ない)という詳細が欠けています。これは私が結論したものです:

<!-- Mandatory block in AppManifest transform files: --> 

<App xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" 
    Name="Not transformed" 
    ProductID="{12345678-0000-0000-0000-123456789123}" 
    Version="0.0.0.0" 
    SharePointMinVersion="0.0.0.0" 
> 
    <Properties> 
    <Title>Not transformed</Title> 
    <StartPage>Not transformed</StartPage> 
    </Properties> 

    <AppPrincipal> 
    <RemoteWebApplication ClientId="*" /> 
    </AppPrincipal> 
</App> 
<!-- 
This block as it is written will cause no transformation whatsoever, but all elements above must be present for any transformation to be applied. 
To transform an entire element along with its text content, add the attribute xdt:Transform="Replace" to the element. This will also replace all 
child elements. 
--> 

希望です!

+0

これはapp.configファイルに適用されますが、app.Manifestファイルでも機能しますか? – Lareau

+0

はい、それはありますが、少しの努力が必要です。私はちょうど役に立つかもしれない明確な例を加えました! –

関連する問題