2
A
回答
0
添加文件到您的项目称为:App.config.install.xdt
在你.nuspec文件中加入:
<files>
<file src="App.config.install.xdt" target="content\App.config.install.xdt" />
</files>
https://msdn.microsoft.com/en-us/library/dd465326.aspx
下面的例子显示的内容一个转换文件,用于更改连接字符串并替换customErrors元素
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB"
connectionString="value for the deployed Web.config file"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
</system.web>
</configuration>
请注意“.transform”文件,如果您想要添加一个非称为app.config的文件,则需要该文件。
相关问题
- 1. Nuget项目类库
- 2. 构建类库(包)NuGet包没有Visual Studio的项目
- 3. NuGet包转换配置转换文件
- 4. 根据目标项目重命名nuget包内容文件
- 5. Nuget包中的转换文件问题
- 6. ASP.NET 5:错误的NuGet包类库包
- 7. NuGet包没有添加文件到Visual Studio项目
- 8. 您在哪个文件中为.NET Core项目设置nuget包?
- 9. Nuget:添加文件到消费项目?
- 10. Nuspec为NuGet包与UWP项目
- 11. 为框架项目创建nuget包
- 12. Xamarin - 在特定于平台的库中包含Windows NuGet项目
- 13. 为什么Windows C#项目在.nuget文件夹中包含nuget可执行文件?
- 14. .Net定制的NuGet项目包类无法找到
- 15. 自定义项目类型的NuGet包管理器
- 16. NuGet包文件丢失
- 17. 将Nuget包从一个项目添加到另一个项目
- 18. 如何在NuGet转换文件中包含当前包版本?
- 19. PhantomJS nuget软件包不会在.NET Core项目中安装.exe文件
- 20. 使用NuGet/Powershell从项目中删除文件夹和文件
- 21. 如何在.Net Core项目中离线安装nuget软件包?
- 22. Netstandard1.x无法为netstandard1.x项目安装Nuget软件包
- 23. Eclipse android程序包不包含库项目中的.so文件
- 24. 将.exe项目转换为类库
- 25. 查找包含Maven项目中的类文件的jar包
- 26. 网络项目上的Nuget包将所有内容文件重命名为'content'
- 27. Nuget包还原反复将其自身添加到项目文件
- 28. Nuget包 - 将文件重命名为基于项目命名空间
- 29. 构建VS项目中的Nuget包不会读取自述文件或Web.Config.Transform
- 30. 是否有可能更改nuget包将文件添加到项目的位置?