相关疑难解决方法(0)

Web.config转换:无法识别的属性'xmlns:xdt'.请注意,属性名称区分大小写

我在MVC 3.0项目中遇到这个奇怪的间歇性错误当我构建项目时,有时会收到以下错误消息:

无法识别的属性'xmlns:xdt'.请注意,属性名称区分大小写.

这是指标准的web.config转换文件(下面复制的Web.Release.config)没有其他错误或警告.这是在调试模式和发布中发生的.如果我清理解决方案,有时它会清除

开始更新

发现了这个问题.在MVC项目文件(MyProject.csproj)中,我将构建视图设置为true

<MvcBuildViews>true</MvcBuildViews>
Run Code Online (Sandbox Code Playgroud)

一旦回到,上面的错误消失了.我想建立视图,因为它停止了很多愚蠢的视图代码错误等,并且是性能增强(页面是预编译而不是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 …
Run Code Online (Sandbox Code Playgroud)

web-config asp.net-mvc-3

44
推荐指数
3
解决办法
2万
查看次数

标签 统计

asp.net-mvc-3 ×1

web-config ×1