<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2030/1/7/_/styles/combined.css?spaceKey=TOP&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Building+.Net+Components+for+Asterisk+SCF">Building .Net Components for Asterisk SCF</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~khunt">Ken Hunt</a>
</h4>
<br/>
<h4>Changes (3)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" > <br>h2. Installation/Build Notes <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">1.</span> <span class="diff-added-words"style="background-color: #dfd;">h4.</span> Build Ice <br></td></tr>
<tr><td class="diff-unchanged" >Asterisk SCF currently requires a custom version of Ice, so if you haven't done so, you must build Ice from the source found in the Asterisk SCF Ice repo. In particular, you must build the cpp and cs sub-folders in the Ice build tree. <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >{info} <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">2.</span> <span class="diff-added-words"style="background-color: #dfd;">h4.</span> Install the Ice 3.4 Visual Studio Plugin <br></td></tr>
<tr><td class="diff-unchanged" >The Visual Studio Plugin will not install unless the MSI downloaded from ZeroC detects that Ice 3.4.1 has been installed on your system. However, it will fail to detect this because we are using a locally built version of Ice. To get around this problem, you should set the InstallDir key for the Ice software to the location where your build process is installing Ice, which is typically at C:\Ice-3.4.1\ <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >Once you get the Ice plugin installed, open the Visual Studio solution installed in the /slice folder. If the plugin installed correctly, you should see the new menu option "Tools > Ice Configuration..." <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">3.</span> <span class="diff-added-words"style="background-color: #dfd;">h4.</span> Build <br></td></tr>
<tr><td class="diff-unchanged" > <br>Check the References node to make sure the Ice assembly is located. It is assumed to be in the default custom-build location, which is C:\Ice-3.4.1\bin. If you configured Ice build process to install in some other location, update the Ice reference. <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<h2><a name="Building.NetComponentsforAsteriskSCF-Overview"></a>Overview</h2>
<p>This page describes how to build the Asterisk SCF slice-defined Application Programming Interface (API) for components written in .Net languages. </p>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>All core Asterisk SCF components are currently written in C++. Building the API for .Net is only required if you wish to build your own Asterisk SCF components using .Net languages.</td></tr></table></div>
<h2><a name="Building.NetComponentsforAsteriskSCF-SoftwareRequirements"></a>Software Requirements</h2>
<ul>
        <li>.Net framework 3.5</li>
        <li>Ice Third Party Libraries - <a href="http://www.zeroc.com/download.html" class="external-link" rel="nofollow">http://www.zeroc.com/download.html</a></li>
        <li>Visual Studio 2008 (or greater) <a href="http://www.microsoft.com/visualstudio/en-us/" class="external-link" rel="nofollow">http://www.microsoft.com/visualstudio/en-us/</a></li>
        <li>Ice plugin for Visual Studio. <a href="http://www.zeroc.com/vsplugin.html" class="external-link" rel="nofollow">http://www.zeroc.com/vsplugin.html</a></li>
</ul>
<h2><a name="Building.NetComponentsforAsteriskSCF-Installation%2FBuildNotes"></a>Installation/Build Notes</h2>
<h4><a name="Building.NetComponentsforAsteriskSCF-BuildIce"></a>Build Ice</h4>
<p>Asterisk SCF currently requires a custom version of Ice, so if you haven't done so, you must build Ice from the source found in the Asterisk SCF Ice repo. In particular, you must build the cpp and cs sub-folders in the Ice build tree.</p>
<p>Taking into account that the Ice build system places generated object code next to the source (for both debug and release builds), we recommend that, on Windows at least, you clone the Ice repo into two different locations, one for release and one for debug. You will want a release build of the cpp folder so that you get a release version of the slice2cs utility, and you will probably want a debug build of both the cpp and cs folders. Follow the INSTALL.WINDOWS instructions in those folders to build. </p>
<p>If you follow this advice, in your release source Ice source tree, make sure you configure it for Release as follows:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>1. Edit the cpp\config\Make.rules.mak
2. Uncomment the line: OPTIMIZE = yes
3. Build as usual, using: nmake /f Makefile.mak install
</pre>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>A common problem encountered with the VS 2008 command prompt is that the C# compiler may not be in your path. If you have installed numerous SDKs (as many developers do), the FrameworkDir variable may be set to a useless value. This will cause you to get the error message: "csc was not a recognized command." To correct this, edit your vcvars32.bat file in a similar manner to this:
<p><b>OLD:</b><br/>
@SET FrameworkDir=Framework32<br/>
@SET FrameworkVersion=v2.0.50727</p>
<p><b>NEW:</b><br/>
@SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework<br/>
@SET FrameworkVersion=v2.0.50727<br/>
@SET Framework35Version=v3.5</p></td></tr></table></div>
<h4><a name="Building.NetComponentsforAsteriskSCF-InstalltheIce3.4VisualStudioPlugin"></a>Install the Ice 3.4 Visual Studio Plugin</h4>
<p>The Visual Studio Plugin will not install unless the MSI downloaded from ZeroC detects that Ice 3.4.1 has been installed on your system. However, it will fail to detect this because we are using a locally built version of Ice. To get around this problem, you should set the InstallDir key for the Ice software to the location where your build process is installing Ice, which is typically at C:\Ice-3.4.1\</p>
<p>To set the InstallDir key:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>1. Run regedit
2. Make sure the key: HKEY_LOCAL_MACHNINE\SOFTWARE\ZeroC\Ice 3.4.1\ exits. If not, create it.
3. Add the string value: InstallDir = C:\Ice-3.4.1\
</pre>
</div></div>
<p>Once you get the Ice plugin installed, open the Visual Studio solution installed in the /slice folder. If the plugin installed correctly, you should see the new menu option "Tools > Ice Configuration..."</p>
<h4><a name="Building.NetComponentsforAsteriskSCF-Build"></a>Build</h4>
<p>Check the References node to make sure the Ice assembly is located. It is assumed to be in the default custom-build location, which is C:\Ice-3.4.1\bin. If you configured Ice build process to install in some other location, update the Ice reference. </p>
<p>Select Build > Build Solution to compile the project and create an AsteriskSCFDotNetApi.dll </p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+.Net+Components+for+Asterisk+SCF">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=8127046&revisedVersion=5&originalVersion=4">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+.Net+Components+for+Asterisk+SCF?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>