UCMA(OCS) 开发系列之二(安装与部署)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/oscar999/article/details/78431417

打包

使用Visual Studio 2013 发布方式如下:

1. 右键工程 --》publish

2. Publish method 选择File System

3. Configuration选择Release, 其他一直next 就可以了

IIS安装与配置

1. 安装IIS服务器

到电脑管理

在角色中添加 IIS 服务

安装的时候把ASP.NET 勾选上

2. 安装.net 4.5
3. 注册.net 4.5 到IIS
cmd 到 C:\Windows\Microsoft.NET\Framework\v4.0.30319
执行 aspnet_regiis -i


4. 部署代码
D盘新建一个 ocs 目录,结构如下

aspnet_client 是后来自动产生的。 原本就App_Code目录和message.asmx 和Web.config
App_Code 三个文件, 和在 local 测试的代码是类似的

以上代码可以在github有偿获取:

https://github.com/oscar9999/MyCode/tree/master/ocs

<%@ WebService Language="C#" CodeBehind="~/App_Code/message.cs" Class="message" %>




<?xml version="1.0" encoding="UTF-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
     <webServices>
         <protocols>
            <add name="HttpSoap" />
            <add name="HttpPost" />
            <add name="HttpGet" />
            <add name="Documentation" />
         </protocols>
      </webServices>
    <customErrors mode="Off"/>

    <compilation targetFramework="4.5">
      <assemblies>
        <add assembly="Microsoft.Rtc.Collaboration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5" />


  </system.web>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
    </system.webServer>
</configuration>


真正需要的配置只有
<compilation targetFramework="4.5">
      <assemblies>
        <add assembly="Microsoft.Rtc.Collaboration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
其他的可以不加。


以下的目的是可以在非localhost的机器上测试
     <webServices>
         <protocols>
            <add name="HttpSoap" />
            <add name="HttpPost" />
            <add name="HttpGet" />
            <add name="Documentation" />
         </protocols>
      </webServices>

5. 在IIS的管理控制台上新建一个site

6. 输入Site name 和Physical Path, 其他默认

7. 这样在页面中 访问就可以了。 http://localhost/message.asmx

错误解决

使用IE 出现如上错误。

使用Chrome出现以下错误:

找不到SIPEPS,还是那个原因 , UCMA必须运行在64 为系统中。





The exception can be very bewildering because UCMA projects don’t require an explicit reference to this SIPEPS DLL, and often you’ll get the exception even if you locate the DLL and move it into the same directory as your application.




usually caused by one of two things:
You’ve targeted the wrong version of the .NET Framework.
You’ve targeted the wrong type of CPU.

 

猜你喜欢

转载自blog.csdn.net/oscar999/article/details/78431417
今日推荐