zoukankan      html  css  js  c++  java
  • Asp.Net MVC项目编译View

    Asp.Net MVC项目在编译代码同时编译View,需要手动修改Project文件。

     用Notepad或其他文本编辑器打开Project文件,或者直接在Visual Studio中Unload project,然后右键点Project,选择Edit Project菜单,

    将 MvcBuildViews改为true,如下:

    <MvcBuildViews>true</MvcBuildViews>

    修改后保存并Reload project,此时编译代码的同时也会编译各个View。

    如果出现如下编译错误 

     Error 47 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. ...\obj\release\csautoparameterize\original\web.config

    这不是代码错误引起的,看起来是编译的时候这个输出文件夹被当做一个IIS虚拟目录来对待,但当前的appplication确不是IIS上部署的应用。

    解决办法: 

    只需要将代码目录下的obj文件夹删掉,重现编译即可。 

  • 相关阅读:
    逆向测试设计
    JNLP
    3. 技术专题
    8.2. Angular使用Material控件库
    Spring Boot Actuator
    安装
    apk文件结构及反编译/代码混淆
    Visual Studio中attach进程进行调试
    .NET反编译
    3. 技术专题
  • 原文地址:https://www.cnblogs.com/dlbrant/p/2433225.html
Copyright © 2011-2022 走看看