链接:https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument113245

In this lesson, you will learn how to deploy an ASP.NET XAF application using the Xcopy Deployment method. This method is named after thexcopy command-line utility, which copies files from one location to another. With this method, you simply copy the application files from the Developer Workstation to the Web Server. Instead of the xcopy utility, you can use Windows Explorer or other file manager to copy files. However, in certain cases, a command-line utility can be more convenient than graphical user interface (GUI) tools. To learn more about thexcopy command capabilities, refer to the xcopy document.

Perform the following steps at the Developer Workstation to prepare the ASP.NET application for Xcopy deployment.

  • Open the MySolution solution in Visual Studio. In the Solution Explorer, expand the MySolution.Web\References folder. Select assemblies whose names start with "DevExpress". If you use Entity Framework, third-party controls or modules, select their assemblies as well. In the Properties window, set the CopyLocal property to True.

    Repeat this step for all module projects that are referenced in the application project (e.g. MySolution.Module andMySolution.Module.Web).

  • Change the Active Solution Configuration from Debug to Release.

  • Open the MySolution.Web\Web.config file. In the system.web section, set the compilation's debug option to false.

    Xml
     
    <system.web>
    <!-- ... -->
    <compilation debug="false">
    <!-- ... -->
    </system.web>
  • Build and run the ASP.NET application.

  • Check that the application performs correctly and close it.

  • Ensure that the MySolution\MySolution.Web folder contains application files.

  • If the MySolution\MySolution.Web\Bin folder contains PDB files, remove them.

Now the ASP.NET application is ready for Xcopy deployment.

  • Create an application folder on the Web Server (for instance, C:\Sites\MySolution). Copy the MySolution\MySolution.Web folder contents from the Developer Workstation to the newly created folder. Use the Internet Information Services (IIS) Manager to create themysolution virtual application folder linked to the c:\Sites\MySolution folder in the server file system. The IIS Manager is accessible from the server Start Menu | Administrative Tools.

    As an ASP.NET application project has references to several module projects (e.g. MySolution.Module.Web and MySolution.Module), then it is required to deploy referenced assembles of these modules. Copy these assemblies from output folders of referenced module projects (i.e. MySolution\MySolution.Module.Web\Bin\Release and MySolution\MySolution.Module\Bin\Release). Assembly files from these output folders should be copied to the Bin subfolder of the application folder (e.g. C:\Sites\MySolution\Bin). You can skip overwriting files that are copied already.

    Note

    If you are deploying an application to remote web hosting, you do not need to create a folder via the IIS Manager. Simply create the mysolution subfolder in the web root folder (typically, it is named wwwroot). Upload the MySolution\MySolution.Web folder contents from the Developer Workstation to the created folder (for instance via FTP). Contact hosting support if you experience problems accessing the web root folder.

  • If the application is localized, and pre-built satellite assemblies are used in it, do the following.

    1. Create a subfolder in the bin folder. The subfolder name should be the culture code (for instance, "de" for the German language).
    2. Copy the required satellite assemblies to the subfolder.
    3. Check to make sure that the target language is added to the application configuration file (Web.config).

      Xml
       
      <appSettings>
      <!-- ... -->
      <;add key="Languages" value="en;de" />
      <!-- ... -->
      </appSettings>

      The supported languages are specified via the Languages key. This key value consists of supported language codes, separated by semicolons.

    If there are several localization languages, repeat these steps for each language.

  • Open a web browser, either locally at a Web Server or at any remote workstation that has access to a Web Server. If you launched a Web Server local browser, type "http://localhost/mysolution/" in the browser address bar. If you launched the browser on a remote workstation, type "http://localhost/mysolution/" or "http://<your_server_name>/mysolution" instead. Press ENTER. If the Web Server displays an error message stating that an assembly is missing, then the reported assembly not being copied to theMySolution.Web\Bin folder from the Developer Workstation Global Assembly Cache (GAC) when building the application.

    To resolve this error, copy the required assembly to the Bin folder on the Web Server. There are two locations on the Developer Workstation where you can get the required assembly.

    • %PROGRAMFILES%\DevExpress 14.2\Components\Bin\Framework
    • %PROGRAMFILES%\DevExpress 14.2\Components\Bin
    Note

    You can register the required assembly in the GAC, instead of copying it to the application folder. Navigate to the c:\Windows\assembly folder in Windows Explorer and drop the assembly file into it. The assembly will be registered in the GAC.

    Refresh the web page, and see if there is another missing assembly. Copy it from the Developer Workstation. Repeat the process until there are no errors reported on missing assemblies.

    Note that if you are browsing your application from a remote workstation using the "http://<your_server_name>/mysolution" URL, the following brief error page that does not contain a missing assembly name may be displayed.

    Web server error messages may contain information meant only for developers, and not public access. That is why the display of unhandled error information is disabled in ISS by default. Launch a browser and open the application at the Web Server locally, if possible. If you have no such access, modify the application Web.config file as shown below.

    <system.web>
    <!-- ... -->
    <customErrors mode="Off">

    This will give you the ability to obtain detailed error descriptions at a remote browser (usually it will be a message about a missing assembly). For security reasons, we recommend that you undo these changes in the Web.config file after successful deployment.

    Note

    Only run-time assemblies from the Developer Workstation are required. Ensure that you do not accidentally copy design-time assemblies or XML files that are named after the run-time assemblies.

  • Finally, the application will display the following message.

    It means that all assembly requirements are satisfied and the application now requires a proper connection string in its configuration file, as well as access to its database. The Set Up the Database Connection lesson describes how to resolve this issue.

Note

If you experience any problems performing the steps in this lesson, refer to the Deployment Troubleshooting Guide lesson.

Now your application needs a connection to a database to run properly. Proceed to the Set Up the Database Connection lesson to learn how to do it. To familiarize yourself with alternative deployment methods, take one of the following lessons.

使用XCopy发布网页的更多相关文章

  1. Rafy 框架-发布网页版用户手册

    前段时间把 Rafy 的用户手册由 CHM 格式转换为了网页格式,而且发布到了 github.io 上,即方便文档的实时更新,也方便大家查看. Rafy 用户手册网页版地址: http://zgynh ...

  2. 利用花生壳和IIS发布网页过程

    老早利用做过类似的事情,但最近又忘了怎么弄的了,还是自己给自己总结下,省得以后到处找了. [动态域名绑定] 如果具有公网IP地址,申请一个免费的花生壳动态域名,再下一个花生壳客户,使用已经申请好的动态 ...

  3. 用IIS进行部署,发布网页,运行DEMO

    因项目需要,正在学习如何部署IIS服务,并发布网站,发布以后,运行网页,具体步骤如下: 一.IIS的部署 在进行部署前,需要将一些必要的配置选好,如图: 打开选项,进行设置,将箭头部分进行勾选 在wi ...

  4. 关于用IIS在.net平台发布网页的一些坑

    说明:由于需要显示页面的表格的内容,要用pageOffice插件,而装pageoffice之前需要装.net3.5,直接导入. 为什么要分别装.net4.5和.net3.5 ? 都要装?  问题:刚才 ...

  5. 福利到!Rafy(原OEA)领域实体框架 2.22.2067 发布!

    距离“上次框架完整发布”已经过去了一年半了,应群中的朋友要求,决定在国庆放假之际,把最新的框架发布出来,并把帮助文档整理出来,这样可以方便大家快速上手.   发布内容 注意,本次发布,只包含 Rafy ...

  6. WIN8+VS2013编写发布WCF之二(部署)

    上文简介了如何建立WCF工程并且调试,下面说一下如何部署. 本文将陆陆续续讲述三种部署方式,随着项目的进展将不断补全. 声明: 用管理员身份打开VS2013,发布前请将程序的.net版本改成与服务器相 ...

  7. Labview学习之程序Web发布

    Labview学习之程序Web发布 1. LabVIEW Web服务器     在LabVIEW开发环境中,自身带了一个已连接好的Web服务器.LabVIEW Web服务器除了与其他Web服务器一样能 ...

  8. WIN8+VS2013编写发布WCF、一(编写)、二(部署)、三(调用)

    原文://http://www.cnblogs.com/tntboom/p/4348483.html 引言:上学期因为写服务器用WCF,所以连查资料再瞎调试勉强成功了,但是这学期又到了用WCF的时候, ...

  9. C#做完一个网站怎么发布?

    前段时间在局域网上发布了一个自己做的网站,发布过程中遇到了不少问题.下面就发布过程和发布过程中遇到的问题与(你)大家一起分享一下,希望对(你)大家有所帮助吧! 在将ASP.NET网站发布到服务器之前需 ...

随机推荐

  1. [转载] FFmpeg 错误 C4996: ‘avcodec_alloc_frame’: 被声明为已否决 解决方法

    在 Visual Studio 2013 下编写 FFmpeg 程序时出错,错误如下: 出错代码如下: 解决方法为:将 avcodec_alloc_frame() 替换为 av_frame_alloc ...

  2. yii2 html下拉框

    下拉框 带默认值 <?php $form=ActiveForm::begin(); echo $form->field($model,'uname', ['inputOptions'=&g ...

  3. c# 修改appConfig文件节点

    配置文件对于程序的帮助是不可小视的,尤其是java工程师们,当然了,我这里说的是c#的配置文件.废话不多说了,直接上代码了,想必大家一看就会明白了 private string UpdateConfi ...

  4. Effective java笔记4--方法

    一.检查参数的有效性 极大多数方法和构造函数都会对于传递给它们的参数值有某些限制. 对于公有的方法,使用Javadoc @throws标签(tag)可以使文档中记录下“一旦针对参数值的限制被违反之后将 ...

  5. Php 笔记4-----php 细节知识

    从 php5开始  php.ini  register_globals参数为OFF  ,禁止全局变量. 以前的情况下,  全局变量是默认为On的 , 所以,浏览器的表单中控件,会自动根据name在服务 ...

  6. 《Windows程序设计第5版》学习进度备忘

    书签:另外跳过的内容有待跟进 __________________学习资源: <Windows程序设计第5版珍藏版> __________________知识基础支持: _________ ...

  7. Mac OS X 10.9 编译C++11

    Notice: How to compile C++ with C++ 11 support in Mac Terminal stackoverflow上面的问题 其实mac里面的不是g++而是cla ...

  8. MATLAB Coder从MATLAB生成C/C++代码步骤

    MATLAB Coder可以从MATLAB代码生成独立的.可读性强.可移植的C/C++代码. 使用MATLAB Coder产生代码的3个步骤: 准备用于产生代码的MATLAB算法: 检查MATLAB代 ...

  9. VHDL之Port map and open

    编SPI的master控制器,使用公司基本的元件,有些端口用不着,恰巧好二哥(不知年龄的数字组组长,本名Holger)来了,于是请教之,告曰open关键词.后来深感自己VHDL水平太水,下了一本电子书 ...

  10. The Stereo Action Dimension

    Network MIDI on iOS - Part 1   This is an app I wrote to try out some ideas for networked MIDI on iP ...