[英]How can I package a xaml template into a nuget package for other developers to reuse?
我使用一些可重用的代碼和框架創建了 nuget,這些代碼和框架是我為其他開發人員創建的,以便更快地利用和開發解決方案。 nuget 托管在我們的私人 nuget 提要上。 我們的應用程序是一個具有 clickonce 部署策略的 WPF 應用程序。 現在我想為開發人員提供我用作模板的 mainwindow.xaml,以便我可以創建標准化。 Is there any way I can package the mainwindow.xaml as a reusable template in the same nuget package that I have hosted in my private feed or atleast can I create a new nuget and host it for the same purpose?
You can place the MainWindow.xaml
and MainWindow.cs
files in the content
directory of your NuGet package, and create an Init.ps1
PowerShell script to move those files into the project.
該腳本的參數是:
param($installPath, $toolsPath, $package, $project)
在https://docs.microsoft.com/en-us/nuget/reference/nuspec中有一些關於將文件添加到內容目錄的好信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.