我在VS2010上搞亂了MVC 2.0,並且遇到了乾淨的web配置功能工作的問題。VS2010清潔Web.configs - 不更新
基本上在我的Web.debug.config
我有
<connectionStrings xdt:Transform="Replace">
<add name="ApplicationServices"
connectionString="Server=localhost;Database=SITE_DB;User ID=dbuser;[email protected];Trusted_Connection=False;" />
</connectionStrings>
and in my `Web.config` I have
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
當我運行在調試模式下的網站,我期望XDT:轉換=「替換」將取代什麼是Web整個connectionStrings節.debug.config。
我假設錯了嗎?或者我在做別的不正確的事情。周圍沒有太多的信息,我想我會問你們。
如果他想在的ConnectionStrings元素取代寄託都發生了什麼?現在,Match(名稱)不起作用,對吧?因爲它試圖在connectionStrings _element_上尋找一個名爲'name'的_attribute_ ..它不存在。 attrib存在於 _child_元素中.. (只是在想 - 大聲點,這裏...) –
2010-06-11 00:58:56
Pure.Krome是正確的。您需要刪除Locator變換或將兩個變換移動到添加XNode而不是connectionStrings XNode。 – 2011-03-26 05:24:36