链接: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. HDU 小明A+B 2096

    解题思路:So easy,练手速的,这种题很快1A,但是没有任何成就感.   转念一想,反正水题也就那几题,所以很快就会刷完. #include<cstdio> int main() { ...

  2. RAC 环境下的重要参数

    Oracle 数据库启动时会根据参数文件中提供的相关参数启动Oracle实例.这些参数包括数据库名字.sga,pga的分配,控制文件的位置,undo,process等等.Oracle RAC数据库同样 ...

  3. Nodepad++ tab改成4个空格

    设置-首选项-选项卡设置-使用空格替换

  4. Jsonp和java操作例子

    介绍JSONP之前,先简单的介绍一些JSON.JSON是JavaScript Object Notation的缩写,是一种轻量的.可读的基于文本的数据交换开放标准.源于JavsScript编程语言中对 ...

  5. struts2 action 返回图片流

    数据库为mssql zp字段为image类型 java代码 OutputStream out = null; try { String contenttype = "image/jpeg&q ...

  6. XML序列化成对象

    这个是和ALM上传测试结果结合使用的//把xml序列化成对象以及把对象序列化成xml using System; using System.Data; using System.Configurati ...

  7. [转]Linux的chattr与lsattr命令详解

    转自:http://www.cnblogs.com/yangxia-test/archive/2013/05/24/3096410.html 这两个命令是用来查看和改变文件.目录属性的,与chmod这 ...

  8. [转]Linux中文件权限目录权限的意义及权限对文件目录的意义

    转自:http://www.jb51.net/article/77458.htm linux中目录与文件权限的意义 一.文件权限的意义 r:可以读这个文件的具体内容: w:可以编辑这个文件的内容,包括 ...

  9. n个数的最小公倍数

    Description 求n个数的最小公倍数.   Input 输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数.   Output 为每组测试数据输出它们的最小公倍数,每个测 ...

  10. 坑爹的gltools编译错误解决

    搭边手游,看opengl superbible, 书中代码需要一个gltools库.作者自己提供的code google地址里gltools项目是空的,此一坑. 他的网站(www.starstones ...