MVC 3.0 プロジェクトでこの奇妙な断続的なバグが発生しています。プロジェクトをビルドすると、次のエラー メッセージが表示されることがあります。
認識されない属性 'xmlns:xdt'。属性名は大文字と小文字が区別されることに注意してください。
これは、標準の web.config 変換ファイル (以下にコピーされた Web.Release.config) を参照しています。その他のエラーや警告はありません。これは、デバッグ モードとリリースで発生しています。溶液をきれいにすると時々クリアされます
更新を開始
問題が見つかりました。MVC プロジェクト ファイル (MyProject.csproj) で、ビルド ビューを true に設定しました。
<MvcBuildViews>true</MvcBuildViews>
falseに戻すと、上記のエラーはなくなります。ビューをビルドして、多くの愚かなビュー コード エラーなどを停止し、パフォーマンスを向上させたいと思います (ページは jit ではなくプリコンパイルされます)。
これがエラーの原因を知っている人はいますか?これはバグですか?
更新を終了
<?xml version="1.0"?>
<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an atrribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your Web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>