0
我想在我的app.config中添加一些設置。通過預覽,設置可以正確添加,但不能在構建之後。vb.net app.config xml轉換不起作用
我的App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<!--<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>-->
</entityFramework>
<connectionStrings>
<add name="BackOfficeEntities" connectionString="metadata=res://*/DAL.BackOfficeDAL.csdl|res://*/DAL.BackOfficeDAL.ssdl|res://*/DAL.BackOfficeDAL.msl;provider=System.Data.SqlClient;provider connection string="data source=MySource;initial catalog=***;persist security info=True;user id=***;password=***;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings />
</configuration>
我App.Debug.config生成後
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="inputDirectory" value="C:\Dev\Intranet_MISC\" xdt:Transform="Insert" />
<add key="outputDirectory" value="C:\Dev\Intranet_MISC\Traites\" xdt:Transform="Insert" />
<add key="historyDirectory" value="C:\Dev\Intranet_MISC\XmlHistory\" xdt:Transform="Insert" />
<add key="MH_ID_MOTIF_REPOS_HEBDO" value="16" xdt:Transform="Insert" />
</appSettings>
</configuration>
最後的app.config:
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="inputDirectory" value="C:\Dev\Intranet_MISC\" xdt:Transform="Insert" />
<add key="outputDirectory" value="C:\Dev\Intranet_MISC\Traites\" xdt:Transform="Insert" />
<add key="historyDirectory" value="C:\Dev\Intranet_MISC\XmlHistory\" xdt:Transform="Insert" />
<add key="MH_ID_MOTIF_REPOS_HEBDO" value="16" xdt:Transform="Insert" />
<add key="inputDirectory" value="C:\Dev\Intranet_MISC\"/>
<add key="outputDirectory" value="C:\Dev\Intranet_Dekra_MISC\Traites\"/>
<add key="historyDirectory" value="C:\Dev\Intranet_MISC\XmlHistory\"/>
<add key="MH_ID_MOTIF_REPOS_HEBDO" value="16"/>
</appSettings>
</configuration>
你有原點任何想法的問題?