<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jason Zander的中文博客</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jason_zander/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jason_zander/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:14:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>新的团队、 新的挑战</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/24</link>
      <pubDate>Wed, 19 Sep 2012 19:53:12 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/09/19/24/</guid>
      <description><![CDATA[[原文发表地址]&#160; New Team, New Challenges   [原文发表时间]&#160; 2012-09-19 17:30   上周我们正式启动了 VS2012 和.NET...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址]&#160; </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/09/19/new-team-new-challenges.aspx"><font size="2" face="Microsoft YaHei">New Team, New Challenges</font></a></p> <font size="2" face="Microsoft YaHei"></font>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-09-19 17:30 </font></p>  <p><font size="2" face="Microsoft YaHei">上周我们正式</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2F2012%2F09%2F12%2Ftune-in-to-the-visual-studio-2012-launch.aspx"><font size="2" face="Microsoft YaHei">启动了 VS2012 和.NET Framework 4.5</font></a><font size="2" face="Microsoft YaHei">。在过去几周内，我在伦敦、西雅图、 亚特兰大、 纽约参与启动活动，分享新版本的详细信息，做我所能做的来帮助人们使用新的版本。我可以坦诚地说，这是我所致力于的最好版本（基本上我参与了所有的版本）。我们能够使用一半的里程碑和拥有此版本的更高质量，这得多亏几个内部改善和我们刚发布的新工具集（在以后的博文中，我会分享一些这些改进；我听说你们很多人也正在尝试做类似的事情）。</font></p>  <p><font size="2" face="Microsoft YaHei">我们既已推出，我将接受一个新的挑战——为</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.windowsazure.com%2F"><font size="2" face="Microsoft YaHei">Windows Azure</font></a><font size="2" face="Microsoft YaHei">付出开发努力。我将加入我的新同事Scott Guthrie (另一个 DevDiv 校友) 和Bharat Shah当中。我期待着与Scott和Bharat的合作，以及承担一套新的挑战和技术。目前，云计算是此行业中最令人兴奋的技术之一，我正在加入一个致力于全球范围内炫酷的东西的杰出团队。</font></p>  <p><font size="2" face="Microsoft YaHei">     <br />祝我好运吧</font></p>  <p><font size="2" face="Microsoft YaHei">&#160;</font></p>  <p><font size="2" face="Microsoft YaHei"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>收听Visual Studio 2012启动事件</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/visual-studio-2012</link>
      <pubDate>Thu, 13 Sep 2012 01:40:46 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/09/13/visual-studio-2012/</guid>
      <description><![CDATA[[原文发表地址]&#160; Tune in to the Visual Studio 2012 Launch  [原文发表时间]&#160; 2012-09-12 10:00...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址]&#160; </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/09/12/tune-in-to-the-visual-studio-2012-launch.aspx"><font size="2" face="Microsoft YaHei">Tune in to the Visual Studio 2012 Launch</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-09-12 10:00 </font></p>  <p><font size="2" face="Microsoft YaHei">今天早上，我们在西雅图为VS 2012 启动事件揭开了序幕。你可以在</font><a href="http://www.visualstudiolaunch.com/"><font size="2" face="Microsoft YaHei">http://www.visualstudiolaunch.com/</font></a><font size="2" face="Microsoft YaHei">收听现场采访和会话录制。在这篇文章中，我将分享一些我在今天的事件中展示的信息。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>现代应用程序</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">如今是作为一名消费者很酷的时间。一直以来，诞生了新的智能手机、 平板电脑、 超级本和很多酷的小玩意。在这个世界中，用户已经习惯于在他们的应用程序中有很多选择，他们期望从一开始看到某些功能 （连接，触摸，等等）。我们也在企业中看到了越来越多这些相同类型的功能的需求。像 Yammer产品，社会已跨越网络连接，从朋友到我的队友。最后，用户变得比以往任何时候都更快地适应新功能。如果我们想要在这个新的世界取得成功，我们将不得不更改我们创建软件的方式。</font></p>  <p><font size="2" face="Microsoft YaHei">对于开发人员来说，问题是我们如何构建此类应用程序，并以最快时间推出到市场？我们将需要一个系统来让我们能够构建大量的业务和事务性逻辑，并以一种方式公开事物，以便我们可以处理许多异构设备类型，与软件团队一起加快交付。今天的演讲将为你们展示Visual Studio 如何帮助你解决这些问题。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6557.image_662FCE30.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6557.image_5F00_662FCE30.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1777.image_thumb_09EE172D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1777.image_5F00_thumb_5F00_09EE172D.png" width="730" height="359" /></a></p>  <p><b><font size="2" face="Microsoft YaHei"><font size="3">Visual Studio 2012</font> </font></b></p>  <p><font size="2" face="Microsoft YaHei">这些趋势是令人兴奋的，并为用户提供了令人信服的方法来与你的应用程序进行交互。但当开发你的应用程序时，它们也遇到新的挑战。当设计Visual Studio 2012和.NET Framework 4.5时，我们需要紧记这些事情。</font></p>  <p><font size="2" face="Microsoft YaHei">我们想要确保你可以使用你现有的软件资产开始，并利用最新的平台。使用 Visual Studio 2012，你会发现你可以针对多种 Microsoft 和非 Microsoft 客户端。你还可以使用 SharePoint、 SQL Server、 Windows Azure 和 Windows Server创建后端服务。最后，使用System Center集成，你可以管理产品中的应用程序。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7450.image_578A43AD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7450.image_5F00_578A43AD.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5808.image_thumb_64F056B3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5808.image_5F00_thumb_5F00_64F056B3.png" width="730" height="383" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>持续服务</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">在为你的应用程序设计后端服务时，你需要扩展需求，需要可以从不同的客户机访问，并能够利用云端和on-premise组件。VS 2012 和.NET Framework 4.5 包含工具和技术来帮助你在这里取得成功。（其中许多实际上是我之前贴过博文的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2Ftags%2Ffavorite%2Bfeature%2F"><font size="2" face="Microsoft YaHei">&quot;收藏夹功能&quot;</font></a><font size="2" face="Microsoft YaHei">。;-))</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2F2012%2F07%2F23%2Fmy-favorite-features-entity-framework-code-first-and-asp-net-web-api.aspx"><font size="2" face="Microsoft YaHei">ASP.NET Web API 和Entity Framework Code First</font></a><font size="2" face="Microsoft YaHei">是两个用于构建你的服务的有用.NET功能。有了EF Code First，你可以开始通过定义类来用于代表数据模型，并让 EF 为你创建数据库表。然后，你可以创建一个 Web API 控制器来将数据公开作为一个基于 HTTP 的服务，然后此服务可以由REST、 JSON 或 XML 使用。这使得从各种客户端访问该服务变得真的很容易，所以你可以跨任何平台，为手机、平板电脑和浏览器构建一组联合应用程序。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1754.image_6F736726.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1754.image_5F00_6F736726.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1185.image_thumb_3D0F93A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1185.image_5F00_thumb_5F00_3D0F93A7.png" width="454" height="478" /></a></p>  <p><font face="Microsoft YaHei"><font size="2"><i>新的</i><i> ASP.NET Web API </i><i>项目</i></font></font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>Web </b><b>体验</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">你想要使用这些服务的一个地方是来自网站-那儿你就可以利用VS 2012中的最新的 web 工具功能。你会找到一些增强功能 ，如</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2F2012%2F05%2F10%2Fmy-favorite-features-improved-tooling-in-visual-studio-11-for-javascript-developers.aspx"><font size="2" face="Microsoft YaHei">JavaScript IntelliSense</font></a><font size="2" face="Microsoft YaHei">和调试、 HTML 5架构验证、 DOM 资源管理器和新的代码片段。此外签出新的页面监查器，它允许你分析正在运行的 web 页面，并找出生成每个 HTML 元素的代码：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2262.image_7FBC7CBF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2262.image_5F00_7FBC7CBF.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1373.image_thumb_5B2AEF3B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1373.image_5F00_thumb_5F00_5B2AEF3B.png" width="734" height="442" /></a></p>  <p><font size="2" face="Microsoft YaHei">最后，当你都完成了，你可以使用 Visual Studio 发布向导来将网站部署到 Windows Azure。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>连接的设备</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">一旦设置了你的服务之后，你将想要从你在连接的设备上运行的客户端应用程序访问它们 （通过使用 Web API）。这些应用程序可能包括现有的桌面程序、 新的 Windows 商店应用程序、 Windows Phone应用程序或另一种平台的应用程序。VS 2012 引入新的功能来帮助开发这些应用程序，如 C# 和 VB 的异步和等待关键字，这简化了异步编程，从而导致响应速度更快的应用程序。你还会在Visual Studio 中找到一个新的且增强的 XAML 编辑器，以及在Blend for Visual Studio 2012中找到 Windows 商店应用程序的设计工具。如果你决定为你现有的桌面应用程序创建Windows商店版本，VS 2012 包括portable libraries（便携式库），这允许你重构你的应用程序逻辑，以便它可以从WPF 和 Windows 商店应用程序 （和 Windows Phone 以及各种其他客户端）被使用。我们也已经在此版本中添加了强大的C+ + 图形工具，以用于编辑、 使用顶点着色器、 像素着色器和输出合并，以及调试、 使用像素历史记录和其他诊断工具：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6177.GraphicsTools_6BC76938.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6177.GraphicsTools_5F00_6BC76938.png"><img title="GraphicsTools" border="0" alt="GraphicsTools" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0207.GraphicsTools_thumb_2C8E60FD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0207.GraphicsTools_5F00_thumb_5F00_2C8E60FD.png" width="734" height="393" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>结论</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">这真的只是对如何使用 VS 2012 和.NET 4.5 构建现代的&quot;哇噻&quot;你的用户的应用程序的一瞥。请确保在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.visualstudiolaunch.com%2F"><font size="2" face="Microsoft YaHei">http://www.visualstudiolaunch.com/</font></a><font size="2" face="Microsoft YaHei">上捕捉到今天的事件的全部覆盖点。你还可以从</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fsomasegar%2Farchive%2F2012%2F09%2F12%2Fvisual-studio-2012-and-net-4-5-launch.aspx"><font size="2" face="Microsoft YaHei">Soma</font></a><font size="2" face="Microsoft YaHei">、</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fbharry%2Farchive%2F2012%2F09%2F12%2Fvisual-studio-update-this-fall.aspx"><font size="2" face="Microsoft YaHei">Brian</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fvisualstudio%2Farchive%2F2012%2F09%2F12%2Fvisual-studio-express-2012-for-windows-desktop-is-here.aspx"><font size="2" face="Microsoft YaHei">Visual Studio 团队博客</font></a><font size="2" face="Microsoft YaHei">阅读有关我们今天的公布。</font></p>  <p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Ftwitter.com%2Fjlzander"><font size="2" face="Microsoft YaHei"> <i>https://twitter.com/jlzander</i> </font></a><i><font size="2" face="Microsoft YaHei">上追随我的脚步。</font></i></p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio 2012 和 .NET Framework 4.5已发布到Web</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/visual-studio-2012-net-framework-4-5web</link>
      <pubDate>Thu, 16 Aug 2012 22:51:56 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/08/16/visual-studio-2012-net-framework-4-5web/</guid>
      <description><![CDATA[[原文发表地址]&#160; Visual Studio 2012 and .NET Framework 4.5 released to the web!  [原文发表时间]&#160;...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址]&#160; </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/08/15/visual-studio-2012-and-net-framework-4-5-released-to-the-web.aspx"><font size="2" face="Microsoft YaHei">Visual Studio 2012 and .NET Framework 4.5 released to the web!</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-08-15 18：50</font></p>  <p><font size="2" face="Microsoft YaHei">我非常高兴地宣布今天早上我们已经将Visual Studio 2012, Team Foundation Server 2012及.NET Framework 4.5发布到了web。是时候发动你的引擎，今天就开始下载吧！</font></p>  <p><font size="2" face="Microsoft YaHei">MSDN订阅者可以立即在</font><a href="http://go.microsoft.com/fwlink/?LinkID=207267"><font size="2" face="Microsoft YaHei">MSDN订阅者下载页面</font></a><font size="2" face="Microsoft YaHei">下载，批量许可用户从明天开始可以从</font><a href="https://www.microsoft.com/Licensing/servicecenter/Registration.aspx"><font size="2" face="Microsoft YaHei">批量许可服务中心</font></a><font size="2" face="Microsoft YaHei">下载。你还可以在大约一个月以后在商店中找到该产品，以及在未来几天可通过</font><a href="http://www.microsoft.com/visualstudio/11/en-us/products/visualstudio"><font size="2" face="Microsoft YaHei">Visual Studio 产品网站</font></a><font size="2" face="Microsoft YaHei">购买一些可用产品。最后，若要评估免费的试用版本或者下载我们的免费Express产品，请访问</font><a href="http://www.microsoft.com/visualstudio/11/en-us/downloads"><font size="2" face="Microsoft YaHei">Visual Studio 产品网站</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font size="2" face="Microsoft YaHei">这是团队很棒的一个发布版本，对于所有我们完成的工作我真的感到非常激动。通过采用敏捷开发模式，引用我们的IDE和ALM工具，我们这次完成发布只用了很多milestone一半的时间。下面是我们发布团队的一张照片，拍摄于最终版本完成的日子：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6215.P1060432_4AED5585.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6215.P1060432_5F00_4AED5585.jpg"><font size="2" face="Microsoft YaHei"><img title="P1060432" border="0" alt="P1060432" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4743.P1060432_thumb_738BC18C.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4743.P1060432_5F00_thumb_5F00_738BC18C.jpg" width="734" height="439" /></font></a></p>  <p><font size="2" face="Microsoft YaHei">为Windows 8开发卓越的应用程序是此版本的一个重要目标。因此，配合今天的开发者工具的发布，你将注意到</font><a href="http://msdn.microsoft.com/en-US/windows/apps/br229516/"><font size="2" face="Microsoft YaHei">Windows 8的最终版本也发布到web</font></a><font size="2" face="Microsoft YaHei">。再者，除了Visual Studio 2012 RTM附带的Blend工具，今天我们还推出了</font><a href="http://go.microsoft.com/fwlink/?linkid=261803"><font size="2" face="Microsoft YaHei">针对Visual Studio 2012的新Blend + SketchFlow 预览</font></a><font size="2" face="Microsoft YaHei"> ，实现了一些顶级Blend客户的要求，它包括支持WPF, Sliverlight, 和SketchFlow. 更多详细信息，请查看Blend团队的博客</font><a href="http://blendinsider.com/"><font size="2" face="Microsoft YaHei">BlendInsider</font></a>。</p>  <p><font size="3" face="Microsoft YaHei"><strong>Visual Studio 2012的12大特色</strong></font></p>  <p><font size="2" face="Microsoft YaHei">假如你还在犹豫是否下载Visual Studio 2012,或者没有同步所有的发布消息，我将给你今天就更新到VS 2012 的12个很好的理由。：）</font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#1）针对Windows 8的开发</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012包含开发Windows 8杀手级应用程序所需的所有工具，从模板到设计器，到测试，再到调试。现在</font><a href="http://blendinsider.com/"><font size="2" face="Microsoft YaHei">Blend</font></a><font size="2" face="Microsoft YaHei">包含在Visual Studio 安装中，它使用HTML/CSS和XAML， 为创建Windows存储应用程序提供了丰富的可视化工具。使用这些工具，你将可以找到你需要用来开发一个优秀的应用程序并提交到Windows存储中的所有东西。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4118.NewProject_3AD247D5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4118.NewProject_5F00_3AD247D5.png"><img title="NewProject" border="0" alt="NewProject" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8132.NewProject_thumb_365BC70E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8132.NewProject_5F00_thumb_5F00_365BC70E.png" width="734" height="509" /></a></p>  <p><font size="2" face="Microsoft YaHei">更多信息，请参阅</font><a href="http://blogs.msdn.com/b/windowsappdev/"><font size="2" face="Microsoft YaHei">Windows 8 应用程序开发者博客</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://msdn.microsoft.com/en-US/windows/apps"><font size="2" face="Microsoft YaHei">Windows 开发者中心</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#2）针对Web的开发</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012和.NET 4.5提供了在</font><a href="http://msdn.microsoft.com/en-us/library/hh420390(v=VS.110).aspx#whatsnew_feature"><font size="2" face="Microsoft YaHei">ASP.NET方面最新的改进</font></a><font size="2" face="Microsoft YaHei">。包括web优化的改进（缩小和捆绑），新的模板，HTML 和CSS 编辑器的改进，页面监察器和新的发布工具。我们增加了新功能来支持</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/10/my-favorite-features-improved-tooling-in-visual-studio-11-for-javascript-developers.aspx"><font size="2" face="Microsoft YaHei">JavaScript 开发</font></a><font size="2" face="Microsoft YaHei">，包括IntelliSense提高，一个新的DOM explorer和JavaScript console. 更多信息，请查看</font><a href="http://blogs.msdn.com/b/webdev/"><font size="2" face="Microsoft YaHei">Web 开发团队博客</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7382.MvcApplication4-Running---Microsoft-Visual-Studio-10_0C8A2283.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7382.MvcApplication4_2D00_Running_2D002D002D00_Microsoft_2D00_Visual_2D00_Studio_2D00_10_5F00_0C8A2283.png"><img title="MvcApplication4 (Running) - Microsoft Visual Studio (10)" border="0" alt="MvcApplication4 (Running) - Microsoft Visual Studio (10)" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5633.MvcApplication4-Running---Microsoft-Visual-Studio-10_thumb_54D76852.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5633.MvcApplication4_2D00_Running_2D002D002D00_Microsoft_2D00_Visual_2D00_Studio_2D00_10_5F00_thumb_5F00_54D76852.png" width="734" height="475" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>页面监察器</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#3） 针对Windows Phone 8的开发</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012 将提供对Windows Phone 8应用程序（同时包括一个Express SKU及一个可自由下载针对VS Pro和在此之上版本的插件）开发的支持。一旦Windows Phone 8 和开发者SDK变成可用，这将在未来上线。一些新功能的期待包括对本地C++的支持，以及面向Phone 7.x 和Windows Phone 8应用程序，多底盘的支持和企业发布功能。在</font><a href="http://windowsteamblog.com/windows_phone/b/wpdev/"><font size="2" face="Microsoft YaHei">Windows Phone团队</font></a><font size="2" face="Microsoft YaHei">上敬请关注更多的信息。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7651.marblemaze_complete_phone_4DA6B32D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7651.marblemaze_5F00_complete_5F00_phone_5F00_4DA6B32D.png"><img title="marblemaze_complete_phone" border="0" alt="marblemaze_complete_phone" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5516.marblemaze_complete_phone_thumb_32959632.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5516.marblemaze_5F00_complete_5F00_phone_5F00_thumb_5F00_32959632.png" width="734" height="442" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>C++ Windows Phone 8应用程序</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#4） 针对Windows Azure 的开发</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 提供了最好的工具来开发你的云服务。在Visual Studio 2012中，你将会注意到云工具的改进， 包括对分布式缓存的支持，新发布选项，新模板和更简单的安装路径。使用Team Foundation Service 和Windows Azure， 你现在可以实现持续性集成和持续性部署你的软件。更多信息，请访问</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/06/07/announcing-the-june-2012-release-of-windows-azure-sdk-for-net-now-with-support-for-visual-studio-2012-rc.aspxhttp:/www.windowsazure.com/en-us/develop/net/"><font size="2" face="Microsoft YaHei">Windows Azure .NET开发者</font></a><font size="2" face="Microsoft YaHei">中心和下载今天发布的</font><a href="http://www.windowsazure.com/en-us/develop/net/"><font size="2" face="Microsoft YaHei">针对.NET的Windows Azure SDK</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6403.Deployed-Builds-in-TFS-Portal_6003834D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6403.Deployed_2D00_Builds_2D00_in_2D00_TFS_2D00_Portal_5F00_6003834D.png"><img title="Deployed Builds in TFS Portal" border="0" alt="Deployed Builds in TFS Portal" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7853.Deployed-Builds-in-TFS-Portal_thumb_14A3DF89.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7853.Deployed_2D00_Builds_2D00_in_2D00_TFS_2D00_Portal_5F00_thumb_5F00_14A3DF89.png" width="676" height="421" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>开发历史</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#5） 开发商务应用程序</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012包含各种开发商务应用程序的工具。SharePoint 开发者将会找到针对列表和内容类型的新设计器，针对网站栏和Silverlight 网站页面的新模板，以及部署SharePoint 网站的新选项。ALM功能，像性能分析，单元测试和IntelliTrace现在对SharePoint开发都已可用了。客户端开发也得到了改善，包括对JavaScript调试和IntelliSense的支持。更多信息，请访问</font><a href="http://blogs.msdn.com/b/sharepointdev/"><font size="2" face="Microsoft YaHei">SharePoint 开发者团队博客</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6661.ListDesigner_0202187A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6661.ListDesigner_5F00_0202187A.png"><img title="ListDesigner" border="0" alt="ListDesigner" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5001.ListDesigner_thumb_3AACC287.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5001.ListDesigner_5F00_thumb_5F00_3AACC287.png" width="734" height="393" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>SharePoint 列表设计器</em></font></p>  <p><font size="2" face="Microsoft YaHei">与此同时，我们还宣布了一个针对Office和SharePoint 2013的新应用程序模型，该模型使你能够将你的应用程序放到云中，并且使用web技术开发它们。Visual Studio 2012,与</font><a href="http://go.microsoft.com/fwlink/?LinkID=261869"><font size="2" face="Microsoft YaHei">Microsoft Office Developer Tools for Visual Studio 2012 – Preview</font></a><font size="2" face="Microsoft YaHei">一起给你提供了工具来使用新应用程序模板开发Office 和SharePoint。学习更多相关知识及开始编译针对Office和SharePoint 2013的业务应用程序，前往</font><a href="http://dev.office.com/"><font size="2" face="Microsoft YaHei">http://dev.office.com</font></a>。</p>  <p><font size="2" face="Microsoft YaHei">LightSwitch 是一个强有力的工具，它用于构建针对桌面和云的业务应用程序。从Visual Studio 2012开始，LightSwitch 是Visual StudioProfessional，Premium和Ultimate安装程序的可用部分。Visual Studio 2012中的LightSwitch 包括各种改进，例如一个新</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/03/15/lightswitch-cosmopolitan-shell-and-theme-for-visual-studio-11-beta-released.aspx"><font size="2" face="Microsoft YaHei">主题</font></a><font size="2" face="Microsoft YaHei">，</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/03/22/lightswitch-architecture-odata.aspx"><font size="2" face="Microsoft YaHei">访问来自任何Odata源的数据以及创建OData服务</font></a><font size="2" face="Microsoft YaHei">，</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/04/03/active-directory-group-support-matt-thalman.aspx"><font size="2" face="Microsoft YaHei">活动目录集成</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/03/28/new-business-types-percent-amp-web-address-andrew-lader.aspx"><font size="2" face="Microsoft YaHei">新业务类型</font></a><font size="2" face="Microsoft YaHei">。我们也正在为支持HTML 客户端而努力，这将会成为VS2012的一个加载项。若要学习更多，请访问</font><a href="http://msdn.microsoft.com/zh-CN/vstudio/ff796201"><font size="2" face="Microsoft YaHei">LightSwitch 开发者中心</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/03/28/new-business-types-percent-amp-web-address-andrew-lader.aspx"><font size="2" face="Microsoft YaHei">LightSwitch 团队博客</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0511.LS_6A57385E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0511.LS_5F00_6A57385E.png"><img title="LS" border="0" alt="LS" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5707.LS_thumb_2370A612.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5707.LS_5F00_thumb_5F00_2370A612.png" width="730" height="557" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>Visual Studio 2012中的LightSwitch</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#6) 开发游戏和其他3D应用程序</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012包含图像工具来帮助游戏开发者提高生产效率，使更容易够建创新的游戏。从调试DirextX图形到设计和编码DirectX着色器（HLSL）, 再到检测和处理图形资产（图像和模型），Visual Studio 2012提供了所有创建2D/3D丰富图形应用程序所需要的功能。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5633.GraphicsImage---Game_3B171786.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5633.GraphicsImage_2D002D002D00_Game_5F00_3B171786.png"><img title="GraphicsImage - Game" border="0" alt="GraphicsImage - Game" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1106.GraphicsImage---Game_thumb_363463CA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1106.GraphicsImage_2D002D002D00_Game_5F00_thumb_5F00_363463CA.png" width="734" height="445" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>Visual Studio 2012 图形诊断工具</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#7）利用最新语言优势</strong></font></p>  <p><font size="2" face="Microsoft YaHei">如果你使用C#或者Visual Basic开发的话，你可以利用Visual Studio 2012和.NET 4.5中语言新功能来进行</font><a href="http://msdn.microsoft.com/en-us/library/hh191443(v=VS.110).aspx"><font size="2" face="Microsoft YaHei">异步编程</font></a><font size="2" face="Microsoft YaHei">。使用新的异步和等待关键字，你可以编写异步代码，它看起来很像同步版本：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3414.Async_24526BF5.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3414.Async_5F00_24526BF5.jpg"><img title="Async" border="0" alt="Async" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0876.Async_thumb_4D5D0AF1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0876.Async_5F00_thumb_5F00_4D5D0AF1.jpg" width="734" height="375" /></a></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012中的C++支持包括完整的 C++ 11标准库以及新的语言功能：无状态ƛ表达式，</font><a href="http://blogs.msdn.com/b/vcblog/archive/2012/04/06/10291485.aspx"><font size="2" face="Microsoft YaHei"> 迭代器</font></a><font size="2" face="Microsoft YaHei">, 基于范围的循环和对作用域枚举的支持。Visual C++ 11 也增加了通过C++/CX和C++ AMP无缝访问Windows运行时组件（），这通过硬件加速来执行你的并行数据C++代码。</font></p>  <p><font size="2" face="Microsoft YaHei">对于JavaScript开发，请参阅在前面我们介绍的Web开发章节来了解有关改进的详细信息。</font></p>  <p><font size="2" face="Microsoft YaHei">最后，如果你使用F#，你将享受到有关丰富信息编程的改进，它使你可以直接对数据服务进行编程，而且F#类型提供着和LINQ 查询使之成为可能。</font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#8）性能，可靠性和兼容性的改进</strong></font></p>  <p><font size="2" face="Microsoft YaHei">除了增加新功能之外，我们还加大投资以提高产品的核心功能。例如我们对性能的投资，在工具箱，键入和编辑，调试和解决方案加载时间等领域我们做出了显著的改进。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3125.SolutionLoad_5E7F14E1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3125.SolutionLoad_5F00_5E7F14E1.png"><img title="SolutionLoad" border="0" alt="SolutionLoad" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4214.SolutionLoad_thumb_575FD869.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4214.SolutionLoad_5F00_thumb_5F00_575FD869.png" width="629" height="367" /></a></p>  <p><font size="2" face="Microsoft YaHei">我们还考虑到了改进Visual Studio 2012的向后兼容性这样你可以和使用Visual Studio 2010 SP1的队友继续在项目上合作。</font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#9）新的IDE高率功能</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012用户界面包含一个外观和感觉的更新，它是与最新微软产品保持一致的，旨在让你可以将注意力集中在代码上。整体环境已经被简化，包括简化的工具栏，一个轻量级的查找对话框，通过预览文件减少了标签组件，而不是在调试过程中打开它们。使用快速启动，你现在可以搜索任何菜单或者命令的IDE。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2727.IDE_54982C53.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2727.IDE_5F00_54982C53.png"><img title="IDE" border="0" alt="IDE" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3716.IDE_thumb_36B9A852.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3716.IDE_5F00_thumb_5F00_36B9A852.png" width="734" height="396" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>新的查找对话框</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#10）随着测试工具的增强提高你的代码质量</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012包含丰富的测试工具。</font></p>  <p><font size="2" face="Microsoft YaHei">Microsoft Test Manager 2012 已经得到了增强来使用探测性测试（有时候叫做敏捷测试），它允许你以任何你想要的方式探索产品，同时保存相关的步骤和数据，你可以使用这些数据直接提交bug和反馈。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2158.Exploratory-Testing_4E06A3E6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2158.Exploratory_2D00_Testing_5F00_4E06A3E6.png"><img title="Exploratory Testing" border="0" alt="Exploratory Testing" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2555.Exploratory-Testing_thumb_2908E36D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2555.Exploratory_2D00_Testing_5F00_thumb_5F00_2908E36D.png" width="734" height="415" /></a></p>  <p><font size="2" face="Microsoft YaHei">在这个发布版本中，Lab Management也被大大简化，通过代理商的整合和引进标准的环境，这让你从构建-部署-测试工作流中受益，而不用依赖于Hyper-V 或者</font><a href="http://technet.microsoft.com/en-us/library/gg610610.aspx"><font size="2" face="Microsoft YaHei">SCVMM</font></a>。</p>  <p><font size="2" face="Microsoft YaHei">在Visual Studio 2012中，我们现在能够让你包括额外的适配器以支持第三方单元测试框架，比如xUnit.net, NUnit等。新的Test Explorer将展示所有跨解决方案的测试，无论它们是为哪个测试框架而写的。 Visual Studio 2012将继续为使用经典的 Visual Studio 单元测试框架而编写的传统单元测试提供支持，并且增加了对使用C++编写的测试的支持。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0181.Unit-Testing_645C492B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0181.Unit_2D00_Testing_5F00_645C492B.png"><img title="Unit Testing" border="0" alt="Unit Testing" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8422.Unit-Testing_thumb_2D15C1F0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8422.Unit_2D00_Testing_5F00_thumb_5F00_2D15C1F0.png" width="734" height="415" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>新的Test Explorer</em></font></p>  <p><font size="3" face="Microsoft YaHei"><strong>#11) 使用工具进行敏捷实践缩短周期</strong></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012包含各种工具来在团队成员间创建透明度，减少时间的浪费和加快项目流程的进行。当你着手启动项目时，使用SharePoint演示图版将会是交流软件需求的有用方式。当你进一步沿用，Microsoft Feedback Client可以用来收集来自外部利益相关者对工作的反馈。</font></p>  <p><font size="2" face="Microsoft YaHei">Team Foundation Server 2012提供了一个丰富的工具集，帮助你规划出你的sprints,管理backlog和跟踪进展情况。我建议阅读</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/29/my-favorite-features-managing-projects-with-the-backlog-sprint-planning-and-taskboard-features-in-team-foundation-server-11.aspx"><font size="2" face="Microsoft YaHei">我早前的博文</font></a><font size="2" face="Microsoft YaHei">，那里我详细探讨了这些功能。作为一个例子，下面是一张任务板的图片，这可以在会议中用来轻松地编辑工作项目。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1856.Taskboard---TFS_258A2EF5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1856.Taskboard_2D002D002D00_TFS_5F00_258A2EF5.png"><img title="Taskboard - TFS" border="0" alt="Taskboard - TFS" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3426.Taskboard---TFS_thumb_00F8A171.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3426.Taskboard_2D002D002D00_TFS_5F00_thumb_5F00_00F8A171.png" width="734" height="451" /></a></p>  <p><font size="3" face="Microsoft YaHei"><strong>#12）推出基于云的服务，操作者和工程之间的顺畅的协作</strong></font></p>  <p><font size="2" face="Microsoft YaHei">我们ALM工具的每个版本，都集成了额外的角色来提高团队的协作，减少周期时间。这个版本中，我们包含了操作，它对于今天基于云的服务应用程序来说越来越重要。你们中的很多人已经使用System Center来监控你产品中的应用程序。这个版本，我们引进了</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/04/17/better-together-tfs-2010-and-system-center-2012.aspx"><font size="2" face="Microsoft YaHei">新的管理包</font></a><font size="2" face="Microsoft YaHei">，它允许System Center 2012 SP1 检测严重的产品问题，并且立即通过TFS和Visual Studio以高质量诊断信息的形式分配给开发团队。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8004.1667.SCOM-TFS_APM_Alert1_6EB28EED.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8004.1667.SCOM_2D00_TFS_5F00_APM_5F00_Alert1_5F00_6EB28EED.png"><img title="1667.SCOM-TFS_APM_Alert[1]" border="0" alt="1667.SCOM-TFS_APM_Alert[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7411.1667.SCOM-TFS_APM_Alert1_thumb_15147239.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7411.1667.SCOM_2D00_TFS_5F00_APM_5F00_Alert1_5F00_thumb_5F00_15147239.png" width="734" height="552" /></a></p>  <p><font size="2" face="Microsoft YaHei"><em>System Center Operations 管理器</em></font></p>  <p><font size="2" face="Microsoft YaHei">我们计划在将来继续推出这些针对操作和工程类型的工具。例如，System Center 2012 SP1将也引进“ Global Service Monitor”(GSM),它允许你监控你的应用程序的功能，性能和来自世界各地多个端点的运行时间。</font></p>  <p><font size="3" face="Microsoft YaHei"><strong>总结</strong></font></p>  <p><font size="2" face="Microsoft YaHei">我很兴奋地看到安装程序已经问世，且可供</font><a href="http://www.microsoft.com/visualstudio/11/en-us/downloads"><font size="2" face="Microsoft YaHei">下载</font></a><font size="2" face="Microsoft YaHei">！正如你所看到的，在这个版本中有一大堆的新功能，它是目前我们推出的Visual Studio最好的版本。我期待看到你能用它做所有令人惊奇的事情。我希望这篇博文能让你一瞥其中的内容。若想要学习更多的内容，我邀请你参加我们在9月12日举行的Visual Studio 2012在线启动仪式，地址是</font><a href="http://www.visualstudiolaunch.com/"><font size="2" face="Microsoft YaHei">http://www.visualstudiolaunch.com/</font></a>。</p>  <p><font size="2" face="Microsoft YaHei">关注我</font><a href="https://twitter.com/jlzander"><i><font size="2" face="Microsoft YaHei">https://twitter.com/jlzander</font></i></a></p>  <p><font size="2" face="Microsoft YaHei"></font></p>  <p><font size="2" face="Microsoft YaHei"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>VS 2012的最终版本-可用性和未来发布日期</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/vs-2012</link>
      <pubDate>Wed, 01 Aug 2012 19:15:00 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/08/01/vs-2012/</guid>
      <description><![CDATA[[原文发表地址]&nbsp; Final Build for VS 2012 - Availability and Launch Dates Ahead
[原文发表时间]&nbsp;...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">[原文发表地址]&nbsp; </span><a href="http://blogs.msdn.com/b/jasonz/archive/2012/08/01/final-build-for-vs-2012-availability-and-launch-dates-ahead.aspx#comments"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">Final Build for VS 2012 - Availability and Launch Dates Ahead</span></a></span></p>
<p><span style="font-family: Microsoft YaHei; font-size: small;" face="Microsoft YaHei" size="2">[原文发表时间]&nbsp; 2012-08-01 9:00 </span></p>
<p><span style="font-family: Microsoft YaHei; font-size: small;" face="Microsoft YaHei" size="2">现已完成Visual Studio 2012的最终版本！工程团队已完成，现正为我们众多的发布渠道准备生成。</span></p>
<p><span style="font-size: small;"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">我还想祝贺今天Windows 8 团队完成了他们重要的RTM版本。你可以在</span><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fb8%2F"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">构建 Windows 8</span></a><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">的博客上阅读更多来自 Windows团队的内容。</span></span></p>
<p><span style="font-family: Microsoft YaHei; font-size: small;" face="Microsoft YaHei" size="2">我期待着到达我们的下一个里程碑，在 8 月15日，我们将让 Visual Studio 2012 可供大家在 MSDN 和其它地方下载。查看我的博客来了解官方发布信息。</span></p>
<p><span style="font-size: small;"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">最后，我想邀请您加入 Soma 和我当中，在 9 月 12日，我们会通过实时的在线活动正式启动 Visual Studio 2012。有关详细信息，请访问</span><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.visualstudiolaunch.com%2F"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">http://www.visualstudiolaunch.com/</span></a><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">。我希望您将继续关注了解更多关于 VS 2012的所有新功能。</span></span></p>
<p><span style="font-family: Microsoft YaHei; font-size: small;" face="Microsoft YaHei" size="2">提前期待未来令人兴奋的日子 ！</span></p>
<p><span style="font-size: small;"><i><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2">在</span></i><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Ftwitter.com%2Fjlzander"><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei" size="2"> <i>https://twitter.com/jlzander</i> </span></a><span style="font-family: Microsoft YaHei;" face="Microsoft YaHei"><span size="2">上<i>追随我的脚步</i><i> </i></span></span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>我最喜爱的功能：Entity Framework Code First和 ASP.NET Web API</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/entity-framework-code-first-asp-net-web-api</link>
      <pubDate>Sun, 29 Jul 2012 19:56:52 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/07/29/entity-framework-code-first-asp-net-web-api/</guid>
      <description><![CDATA[[原文发表地址] My Favorite Features: Entity Framework Code First and ASP.NET Web API  [原文发表时间]&#160;...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址] </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/07/23/my-favorite-features-entity-framework-code-first-and-asp-net-web-api.aspx"><font size="2" face="Microsoft YaHei">My Favorite Features: Entity Framework Code First and ASP.NET Web API</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-07-23 11:59</font></p>  <p><font size="2" face="Microsoft YaHei">这是一个Entity Framework令人激动的时刻！上周四，团队</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fadonet%2Farchive%2F2012%2F07%2F19%2Fentity-framework-and-open-source.aspx"><font size="2" face="Microsoft YaHei">宣布</font></a><font size="2" face="Microsoft YaHei">了一个开放源码的版本，现在它在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fentityframework.codeplex.com%2F"><font size="2" face="Microsoft YaHei">Entity Framework CodePlex 网站</font></a><font size="2" face="Microsoft YaHei">上是可用的。我一直在我个人的开发中使用Entity Framework，我将利用这个机会来使用有关EF的博文继续我的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2Ftags%2Ffavorite%2Bfeature%2F"><font size="2" face="Microsoft YaHei">&quot;最爱的功能&quot;系列</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font size="2" face="Microsoft YaHei">在这篇帖子中，我将使用Entity Framework中的Code First工作流来构建一个应用程序。Entity Framework原先是作为.NET Framework 中的一部分而推出的，但在几经努力之后，已经在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fnuget.org%2Fpackages%2FEntityFramework"><font size="2" face="Microsoft YaHei">NuGet</font></a><font size="2" face="Microsoft YaHei">中推出了最后几个版本，位于.NET Framework的中间版本。除了在 NuGet中可用之外，Entity Framework (EF5) 的最新版本也包含在 Visual Studio 2012 中的很多地方。</font></p>  <p><font size="2" face="Microsoft YaHei">作为构建应用程序的一部分，我也会使用</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.asp.net%2Fweb-api"><font size="2" face="Microsoft YaHei">ASP.NET Web API</font></a><font size="2" face="Microsoft YaHei"> 来构建 一个HTTP 服务。ASP.NET Web API 是我另一个最喜爱的功能，是创建由不同客户端使用的服务的杰出方式。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>EF5 </b><b>中的新增功能</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">我想我会首先简要概述在Entity Framework 5 中的一些新功能，我们将在这篇文章中使用其中的一些。我一直在盼望其中的几个功能，并很高兴看到在最新的版本中添加了它们。</font></p>  <p><font size="2" face="Microsoft YaHei">Entity Framework 5 中的新功能：</font></p>  <ul>   <li><font size="2" face="Microsoft YaHei"><b>枚举支持</b>是EF 久等的功能，并让您在您的域类中拥有枚举属性。EF5 让枚举支持在 EF 设计器和Code First中是可用的。</font></li>    <li><font size="2" face="Microsoft YaHei">现在，现有数据库中的<b>表值函数</b>可以包含在使用 EF 设计器所创建的模型中。</font></li>    <li><font size="2" face="Microsoft YaHei">现在您可以使用DbGeography 和 DbGeometry 类型来在你的模型中公开<b>空间数据类型</b>。空间数据可以包含在由EF 设计器或Code First所创建的模型中。 </font></li>    <li><font size="2" face="Microsoft YaHei">EF5 还包括一些重大的<b>性能改进</b>，你可以在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fadonet%2Farchive%2F2012%2F02%2F14%2Fsneak-preview-entity-framework-5-0-performance-improvements.aspx"><font size="2" face="Microsoft YaHei">ADO.NET 的博客</font></a><font size="2" face="Microsoft YaHei">中找出更多有关内容。</font></li> </ul>  <p><font size="2" face="Microsoft YaHei">包括在 Visual Studio 2012中的<font size="2" face="Microsoft YaHei">EF 设计器</font>，它也有一些新的功能：</font></p>  <ul>   <li><font size="2" face="Microsoft YaHei">现在模型可以被分为<b>多个关系图</b>，在使用大型的模型时，这是很不错的。您还可以<b>应用着色到实体中</b>来帮助您识别您的模型的分区。</font></li>    <li><font size="2" face="Microsoft YaHei">改进了转置模型的向导，使其更容易和更快地为查询数据<b>批量导入存储过程</b>。</font></li> </ul>  <p><font face="Microsoft YaHei"><font size="3"><b>创建应用程序</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">EF5在 Visual Studio 2012 中出现的地方之一是 ASP.NET Web API 的项目模板，因此，如果您创建了一个新的 ASP.NET Web API 项目，默认情况下，在您的项目中，Entity Framework 5是可用的。</font></p>  <p><font size="2" face="Microsoft YaHei">在这篇帖子中，我就会创建一个简单的 web 应用程序来帮助人们找到有趣的旅游景点。我将会创建一个 web 页面以帮助他们找到给定位置最接近的旅游胜地。而不是让web 页面直接与数据库进行通信，我将创建一个 Web API 来公开数据，以便各种平台上的应用程序也可以访问该数据。</font></p>  <p><font size="2" face="Microsoft YaHei">我将由创建一个新的 MVC 4 应用程序来开始，指向.NET 4.5，并选择 ‘Web API’模板。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4643.NewProject_424F7029.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4643.NewProject_5F00_424F7029.png"><img title="NewProject" border="0" alt="NewProject" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1732.NewProject_thumb_0FEB9CAA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1732.NewProject_5F00_thumb_5F00_0FEB9CAA.png" width="687" height="622" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>建立一个模型</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">Code First了不起的事情之一是建立模型就如同定义一组类那么简单。如果需要的话，您还可以提供额外的配置来定义数据库和您的类映射到数据库的方式。</font></p>  <p><font size="2" face="Microsoft YaHei">在我的项目的Models文件夹中，我将添加一个 Models.cs 文件，其中包含了下面的类。</font></p>  <div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">   <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">     <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> <span style="color: rgb(0, 0, 255);">using</span> System.Collections.Generic;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum2">   2:</span> <span style="color: rgb(0, 0, 255);">using</span> System.Data.Spatial;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum3">   3:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum4">   4:</span>   </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum5">   5:</span> <span style="color: rgb(0, 0, 255);">namespace</span> TouristAttractions.Models </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum6">   6:</span> {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum7">   7:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum8">   8:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> TouristAttraction</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum9">   9:</span>     {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum10">  10:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">int</span> TouristAttractionId { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum11">  11:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> Name { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum12">  12:</span>         <span style="color: rgb(0, 0, 255);">public</span> DbGeography Location { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum13">  13:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum14">  14:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum15">  15:</span>         <span style="color: rgb(0, 0, 255);">public</span> List&lt;Review&gt; Reviews { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum16">  16:</span>     }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum17">  17:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum18">  18:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum19">  19:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> Review</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum20">  20:</span>     {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum21">  21:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum22">  22:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">int</span> ReviewId { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum23">  23:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> Author { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum24">  24:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> Comments { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum25">  25:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum26">  26:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum27">  27:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">int</span> TouristAttractionId { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum28">  28:</span>         <span style="color: rgb(0, 0, 255);">public</span> TouristAttraction TouristAttraction { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum29">  29:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum30">  30:</span>     } </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum31">  31:</span> }</pre>
<!--CRLF--></div>
</div>

<p><font face="Microsoft YaHei"><font size="3"><b>添加 一个</b><b>API </b><b>控制器</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">既然我有一个模型了，我要创建一种让我可以读取和写入旅游景点的 API 控制器。API 控制器类似于一个 MVC 控制器，除了它是作为一项服务使用，而不是挂接到一组试图。</font></p>

<p><font size="2" face="Microsoft YaHei">在添加一个控制器之前，我需要首先生成该应用程序。下一步我就会右击Controllers文件夹，然后从上下文菜单中选择Add-&gt; Controller … … '。我将新的控制器命名为 'AttractionsController'，然后选择‘API controller with read/write actions, using Entity Framework’模板。此模板将生成一段使用Entity Framework所读取和写入我的TouristAttraction 类实例的代码。</font></p>

<p><font size="2" face="Microsoft YaHei">我还可以指定我想要为数据访问使用哪些Entity Framework上下文。上下文是一个类，代表与数据库的会话，并让我可以读取和写入数据。我还没有创建一个上下文，所以我就直接从列表中选择 &lt;New data context….&gt;， 这将为我创建一个新的上下文（我称之为 TourismContext）。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5545.AddController_68B15374.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5545.AddController_5F00_68B15374.png"><img title="AddController" border="0" alt="AddController" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4062.AddController_thumb_6B5A0F25.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4062.AddController_5F00_thumb_5F00_6B5A0F25.png" width="608" height="397" /></a></p>

<p><font size="2" face="Microsoft YaHei">当我完成了添加控制器向导时，一些项就被添加到我的项目中。我要求向导所创建的TourismContext 已添加到了Models文件夹中。此类来自 DbContext，它是Entity Framework的主要API。此上下文还为每个我想要访问的类型公开了 DbSet。DbContext 有一套公约来挑选一个数据库试着使用，但 ASP.NET Web API 已覆盖了这些公约，并告诉我的上下文来从config文件中加载其连接信息的（使用构造函数中的&quot;name =&quot;语法）。</font></p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> TourismContext : DbContext </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum2">   2:</span> { </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum3">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> TourismContext() : <span style="color: rgb(0, 0, 255);">base</span>(<span style="color: rgb(0, 96, 128);">&quot;name=TourismContext&quot;</span>)</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum4">   4:</span>     { </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum5">   5:</span>     }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum6">   6:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum7">   7:</span>     <span style="color: rgb(0, 0, 255);">public</span> DbSet&lt;TouristAttraction&gt; TouristAttractions { get; set; }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum8">   8:</span> }</pre>
<!--CRLF--></div>
</div>

<p><font size="2" face="Microsoft YaHei">果然，如果我在 Web.config 中查找，我发现 TourismContext 连接字符串，将我的上下文指向一个称为 TourismContext （后跟一个时间戳，以确保它不会与任何以前的 ASP.NET Web API 项目发生冲突） 的 LocalDb 数据库。</font></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">connectionStrings</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">add</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">name</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot;</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">TourismContext</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot;</span></span></span><span style="font-size: 9.5pt;"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">
          <br /><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">connectionString</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot;</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">Data Source=(localdb)\v11.0; Initial Catalog=TourismContext-20120618160809; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|TourismContext-20120618160809.mdf</span></span></span></span><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot; 
        <br /><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">providerName</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot;</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">System.Data.SqlClient</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff"> /&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 10pt; line-height: 13pt;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="line-height: 11pt; background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160; </span></span><span style="font-size: 9.5pt;">&lt;/</span></span></span><span style="font-size: 9.5pt;"><span style="line-height: 11pt; background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">connectionStrings</span></span></span><span style="line-height: 11pt; background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span></p>

<p><font size="2" face="Microsoft YaHei">最后，API 控制器本身已被添加到Controllers文件夹中。在控制器上编码以支持获取所有的 TouristAttractions、用某个关键词查找 TouristAttraction，并添加、 更新和删除 TouristAttractions。为简洁起见，我只将展示所生成的代码的一部分：</font></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 10pt;">public</span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">class</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">AttractionsController</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> : </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175); font-size: 10pt;" color="#2b91af">ApiController</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">private</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TourismContext</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> db = </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TourismContext</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">();</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 128, 0); font-size: 10pt;" color="#008000">// GET api/Attractions</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">IEnumerable</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">&lt;</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TouristAttraction</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">&gt; GetTouristAttractions()</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">return</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> db.TouristAttractions.AsEnumerable();</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 128, 0); font-size: 10pt;" color="#008000">// GET api/Attractions/5</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TouristAttraction</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> GetTouristAttraction(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">int</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> id)</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TouristAttraction</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> touristattraction = db.TouristAttractions.Find(id);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">if</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> (touristattraction == </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">null</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">)</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">throw</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">HttpResponseException</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">(Request.CreateResponse(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">HttpStatusCode</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">.NotFound));</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">return</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> touristattraction;</span></span></span></p>

<p style="margin: 0in 0in 10pt; line-height: 13pt;" class="MsoNormal"><span style="line-height: 12pt; background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span><span style="font-size: 10pt;">}</span></span></span><span style="line-height: 12pt;"><span style="font-size: 10pt;">
      <br />

      <br /></span><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>... 

        <br />

        <br /></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">}</span></span></span></span></p>

<p><font size="2" face="Microsoft YaHei">我也会添加一个新的 GetTouristAttraction 方法到 AttractionsController中来定位坐标和查找最接近的景点。</font></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 10pt;">public</span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TouristAttraction</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> GetTouristAttraction(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">double</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> longitude, </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">double</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> latitude)</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> location = </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">DbGeography</span></span></span></span><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">.FromText( 
        <br /><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">string</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">.Format(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;POINT ({0} {1})&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;">, longitude, latitude));</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> query = </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">from</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> a </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">in</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> db.TouristAttractions</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">orderby</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> a.Location.Distance(location)</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">select</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> a;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 10pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 10pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">return</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 10pt;"> query.FirstOrDefault();</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 10pt;">}</span></span></span><span></span></p>

<p><font face="Microsoft YaHei"><font size="3"><b>使用</b><b>Web API</b></font></font></p>

<p><font size="2" face="Microsoft YaHei">因为 ASP.NET Web API 使用基本的 HTTP 通信，我的服务可以由来自任意数量的平台和技术所使用。只举一个例子，我将构建一个简单的 web 页面，该页面从 JavaScript 中访问该服务。</font></p>

<p><font size="2" face="Microsoft YaHei">我会用下面的代码替换 Views\Home\Index.cshtml 的内容:</font></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;!</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">DOCTYPE</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">html</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">PUBLIC</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> </span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">html</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">lang</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">=&quot;en&quot;&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">head</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">title</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&gt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">Find Nearest Attraction</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">title</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">meta</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">http-equiv</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;Content-Type&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">content</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;text/html; charset=utf-8&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">/&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">charset</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;UTF-8&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;text/javascript&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> </span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">src</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">=&quot;http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3&amp;mkt=en-us&quot;&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">src</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;../../Scripts/jquery-1.6.2.min.js&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;text/javascript&quot;&gt;&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">=&quot;text/javascript&quot;&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">function</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> search() {</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> lat = $(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">'#latitude'</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">).val();</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> long = $(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">'#longitude'</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">).val();</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">$.ajax({</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">url: </span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;api/Attractions/?longitude=&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> + long + </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;&amp;latitude=&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> + lat,</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">type: </span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;GET&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">,</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">success: </span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">function</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> (data) {</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">if</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> (data == </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">null</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">) {</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">$(</span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">'#attractionName'</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">).html(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;No attractions to search&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">else</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> {</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">$(</span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">'#attractionName'</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">).html(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;You should visit &quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> + data.Name);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">displayMap(data.Location.Geography.WellKnownText, data.Name);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">});</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160; </span></span><span style="font-size: 9.5pt;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160; </span>}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">function</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> displayMap(coordinateString, name) {</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 128, 0); font-size: 9.5pt;" color="#008000">// WellKnownText is in format 'POINT (&lt;longitude&gt;, &lt;latitude&gt;)'</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">coordinateString = coordinateString.replace(</span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;POINT (&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">, </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">).replace(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;)&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">, </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot;&quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> long = coordinateString.substring(0, coordinateString.indexOf(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot; &quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">));</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> lat = coordinateString.substring(coordinateString.indexOf(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">&quot; &quot;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">) + 1);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 128, 0); font-size: 9.5pt;" color="#008000">// Show map centered on nearest attraction</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> map = </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> VEMap(</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(163, 21, 21);" color="#a31515">'myMap'</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">map.LoadMap(</span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> VELatLong(lat, long), 15, VEMapStyle.Aerial);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 128, 0); font-size: 9.5pt;" color="#008000">// Add a pin for the attraction</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">var</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> pin = </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> VEShape(VEShapeType.Pushpin, </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">new</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;"> VELatLong(lat, long));</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">pin.SetTitle(name);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">map.AddShape(pin);</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9.5pt;">}</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">script</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;/</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">head</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">body</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">h1</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&gt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">Find the Closest Tourist Attraction</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">h1</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">div</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">label</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">for</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;longitude&quot;&gt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">Longitude:</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">label</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">input</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;text&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">id</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;longitude&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">size</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;10&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">/&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">label</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">for</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;latitude&quot;&gt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">Latitude:</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">label</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">input</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;text&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">id</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;latitude&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">size</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;10&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">/&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">input</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">type</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;button&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">value</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;Search&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">onclick</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">search();</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">/&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">div</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">p</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">id</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;attractionName&quot;&gt;&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">p</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&lt;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">div</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">id</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">='myMap'</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">style</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">=&quot;</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">position</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">: </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">absolute</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">width</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">: </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">400px</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(255, 0, 0);" color="#ff0000">height</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">: </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">400px</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">;</span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">&quot;&gt;&lt;/</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">div</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;/</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">body</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">&lt;/</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(128, 0, 0);" color="#800000">html</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255); font-size: 9.5pt;" color="#0000ff">&gt;</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p>&#160;</p>

<p><font size="2" face="Microsoft YaHei">此页面的主要功能是在搜索功能。当用户指定坐标来搜索时，此函数将使用 HTTP PUT请求来为最接近的景点请求服务。DisplayMap 函数然后使用 Bing 地图来直观地显示数据。</font></p>

<p><font size="2" face="Microsoft YaHei">如果我运行该项目，我可以测试是否页面显示正确。但是，我们没有任何数据来显示：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3580.WebPageNoData_59114863.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3580.WebPageNoData_5F00_59114863.png"><img title="WebPageNoData" border="0" alt="WebPageNoData" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1016.WebPageNoData_thumb_03E9AC76.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1016.WebPageNoData_5F00_thumb_5F00_03E9AC76.png" width="529" height="360" /></a></p>

<p><font size="2" face="Microsoft YaHei">现在您可能想知道当我并没有做任何事情来创建时，它是如何连接到数据库的。因为我的数据库不存在，Entity Framework Code First使用一套约定来确定该架构看起来应该像什么样的，并为我创建它。我查看我的 LocalDb 实例，我看到它所创建的新数据库： </font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7380.Database_388A08B1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7380.Database_5F00_388A08B1.png"><img title="Database" border="0" alt="Database" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4478.Database_thumb_3F3D1234.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4478.Database_5F00_thumb_5F00_3F3D1234.png" width="370" height="376" /></a></p>

<p><font size="2" face="Microsoft YaHei">放心，如果你不喜欢默认的约定，有大量的选项可用于更改表名、 列名、 数据类型以及几乎创建架构所需的每一个方面。Code First还可用于映射到现有的数据库。这超出了本文的范围，但您可以签出</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fadonet%2Farchive%2F2012%2F04%2F09%2Fef-power-tools-beta-2-available.aspx"><font size="2" face="Microsoft YaHei">EF 动力工具</font></a><font size="2" face="Microsoft YaHei">，然后将它作为一个良好的起点。</font></p>

<p><font face="Microsoft YaHei"><font size="3"><b>播种数据</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">现在我想要在我的数据库中获取一些种子数据，以便我们可以看到正常的 web 页面。我将使用Entity Framework Code First迁移来执行此操作。迁移功能能够让我随着模型的更改而改进数据库（我们很快就会看到这个实际操作)，它也让我可以指定数据库中应该存在的种子数据。</font></p>

<p><font size="2" face="Microsoft YaHei">若要开始使用Code First迁移，我可以使用Package Manager Console中的Enable-Migrations命令来打开我的TourismContext 的迁移。Package Manager Console可以从Visual Studio中的Tools-&gt; Library Package Manager菜单打开。 </font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0830.EnableMigrations_73DD6E6F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0830.EnableMigrations_5F00_73DD6E6F.png"><img title="EnableMigrations" border="0" alt="EnableMigrations" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2818.EnableMigrations_thumb_1AAB84B0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2818.EnableMigrations_5F00_thumb_5F00_1AAB84B0.png" width="745" height="192" /></a></p>

<p><font size="2" face="Microsoft YaHei">启用迁移已添加了几个新的Migrations文件夹到我的项目中，其中包含两项：</font></p>

<p><font size="2" face="Microsoft YaHei">·Configuration.cs — — 此文件允许我为如何迁移我的数据库定义设置。这包括迁移生成的文件夹，种子数据应用到数据库的方式，为第三方数据库 （即 MySql）注册供应商 的事情。</font></p>

<p><font size="2" face="Microsoft YaHei">·&lt;timestamp&gt; _InitialCreate.cs — — 这是迁移，展现了我已应用到数据库中（即创建TouristAttractions 和Reviews表） 的更改。迁移功能已记录在我的本地数据库中。</font></p>

<p><font size="2" face="Microsoft YaHei">我将修改Configuration.cs 来在Seed方法中指定一些种子数据。你会发现我正在使用AddOrUpdate 方法，它可以让我指定一个属性来匹配— — — — 在我的例子中，即为 TouristAttraction 的名称。如果迁移找到具有该名称的现有 TouristAttraction，它将更新其当前值来匹配我所提供的 ；如果没有找到的话，它将插入新的 TouristAttraction。</font></p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> <span style="color: rgb(0, 0, 255);">protected</span> <span style="color: rgb(0, 0, 255);">override</span> <span style="color: rgb(0, 0, 255);">void</span> Seed(TouristAttractions.Models.TourismContext context) </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum2">   2:</span> {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum3">   3:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum4">   4:</span>     context.TouristAttractions.AddOrUpdate(a =&gt; a.Name,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum5">   5:</span>         <span style="color: rgb(0, 0, 255);">new</span> TouristAttraction</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum6">   6:</span>         {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum7">   7:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum8">   8:</span>             Name = <span style="color: rgb(0, 96, 128);">&quot;Space Needle, Seattle&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum9">   9:</span>             Location = DbGeography.FromText(<span style="color: rgb(0, 96, 128);">&quot;POINT(-122.348670959473 47.619930267334)&quot;</span>)</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum10">  10:</span>         });</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum11">  11:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum12">  12:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum13">  13:</span>     context.TouristAttractions.AddOrUpdate(a =&gt; a.Name,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum14">  14:</span>         <span style="color: rgb(0, 0, 255);">new</span> TouristAttraction</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum15">  15:</span>         {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum16">  16:</span>             Name = <span style="color: rgb(0, 96, 128);">&quot;Pike Place Market, Seattle&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum17">  17:</span>             Location = DbGeography.FromText(<span style="color: rgb(0, 96, 128);">&quot;POINT(-122.341697692871 47.6094245910645)&quot;</span>)</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum18">  18:</span>         });</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum19">  19:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum20">  20:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum21">  21:</span>     context.TouristAttractions.AddOrUpdate(a =&gt; a.Name,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum22">  22:</span>         <span style="color: rgb(0, 0, 255);">new</span> TouristAttraction</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum23">  23:</span>         {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum24">  24:</span>             Name = <span style="color: rgb(0, 96, 128);">&quot;Statue of Liberty, NY&quot;</span>,</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum25">  25:</span>             Location = DbGeography.FromText(<span style="color: rgb(0, 96, 128);">&quot;POINT(-74.0439682006836 40.6886405944824)&quot;</span>)</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum26">  26:</span>         });</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum27">  27:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum28">  28:</span> }</pre>
<!--CRLF--></div>
</div>

<p><font size="2" face="Microsoft YaHei">现在我可以从Package Manager Console中运行Update-Database命令，种子数据将被应用到我的本地数据库。当我运行该应用程序时，我可以在实际中看到：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2806.WebPage_5A756B35.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2806.WebPage_5F00_5A756B35.png"><img title="WebPage" border="0" alt="WebPage" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6204.WebPage_thumb_180559B0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6204.WebPage_5F00_thumb_5F00_180559B0.png" width="529" height="767" /></a></p>

<p><font face="Microsoft YaHei"><font size="3"><b>更改模型</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">我有一个简单的应用程序可供运行，但随着时间的推移，我的要求有可能会改变。例如，我可能会决定当用户查看一个景点时，我想要让他们提供一个评级。</font></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff"><span style="font-size: 9.5pt;">public</span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">class</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175); font-size: 9.5pt;" color="#2b91af">Review</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">{</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">int</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> ReviewId { </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">; }</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">string</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> Author { </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">; }</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">string</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> Comments { </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">; }</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="background-color: rgb(255, 255, 0);"><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"><span style="color: rgb(0, 0, 255);" color="#0000ff">int</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"> Rating { </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: yellow;"><span style="font-size: 9.5pt;">; }</span></span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">&#160;</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">int</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span>TouristAttractionId<span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> { </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">; }</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="font-family: consolas;" face="Consolas"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;">&#160;&#160;&#160; </span></span></span><span style="font-size: 9.5pt;"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">public </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(43, 145, 175);" color="#2b91af">TouristAttraction</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> </span><span>TouristAttraction<span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"> { </span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">get</span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;">; </span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="color: rgb(0, 0, 255);" color="#0000ff">set</span></span></span><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-size: 9.5pt;">; }</span></span></span></p>

<p style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal"><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; mso-highlight: white;"><span style="font-family: consolas;" face="Consolas"><span style="font-size: 9.5pt;">}</span></span></span></p>

<p><font size="2" face="Microsoft YaHei"></font></p>

<p><font size="2" face="Microsoft YaHei">但是当我更新我的模型时，它不再与Code First所创建的数据库架构相匹配了。如果运行该应用程序，我会得到一个InvalidOperationException&quot;，说明“自从该数据库被创建以来，模型备份'TourismContext' 上下文已被更改。请考虑使用Code First迁移来更新数据库&quot;。</font></p>

<p><font size="2" face="Microsoft YaHei">我已经启用了迁移来处理数据种子，所以我可以运行Add—Migration AddRating' 命令来将我挂起的更改移到到新的迁移中，并给它一个名称 ('AddRating')。</font></p>

<p><font size="2" face="Microsoft YaHei">运行此命令，则会将一个新的 &lt;timestamp&gt; _AddRating.cs 文件添加到Migrations文件夹中。此文件包含一些步骤来使我的数据库架构与当前的模型相匹配：</font></p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> <span style="color: rgb(0, 0, 255);">namespace</span> TouristAttractions.Migrations </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum2">   2:</span> {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum3">   3:</span>     <span style="color: rgb(0, 0, 255);">using</span> System;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum4">   4:</span>     <span style="color: rgb(0, 0, 255);">using</span> System.Data.Entity.Migrations;</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum5">   5:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum6">   6:</span>     </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum7">   7:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">partial</span> <span style="color: rgb(0, 0, 255);">class</span> AddRating : DbMigration</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum8">   8:</span>     {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum9">   9:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">override</span> <span style="color: rgb(0, 0, 255);">void</span> Up()</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum10">  10:</span>         {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum11">  11:</span>             AddColumn(<span style="color: rgb(0, 96, 128);">&quot;dbo.Reviews&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;Rating&quot;</span>, c =&gt; c.Int(nullable: <span style="color: rgb(0, 0, 255);">false</span>));</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum12">  12:</span>         }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum13">  13:</span>  </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum14">  14:</span>         </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum15">  15:</span>         <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">override</span> <span style="color: rgb(0, 0, 255);">void</span> Down()</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum16">  16:</span>         {</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum17">  17:</span>             DropColumn(<span style="color: rgb(0, 96, 128);">&quot;dbo.Reviews&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;Rating&quot;</span>);</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum18">  18:</span>         }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum19">  19:</span>     }</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum20">  20:</span> } </pre>
<!--CRLF--></div>
</div>

<p><font size="2" face="Microsoft YaHei">因为这只是支架式的代码，我可能会对其进行编辑。例如，我可以创建索引，或添加列或表，而这些列和表并不是我的Code First模型的一部分。我还可以使用 Sql 方法来作为迁移的一部分而执行任意 SQL。</font></p>

<p><font size="2" face="Microsoft YaHei">此示例中的支架式代码是不错的，所以我将运行Package Manager Console中的Update-Database命令。此命令将检查该数据库以查看哪些迁移已应用、然后与我的项目中的迁移相比较，并应用任何待定的迁移。既然已经更新了架构，那么我可以再次运行应用程序，一切都正常。 </font></p>

<p><font face="Microsoft YaHei"><font size="3"><b>结论</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">我希望这篇文章让你更深入了解Entity Framework Code First和 ASP.NET Web API。若要了解有关Entity Framework，我推荐访问</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.com%2Fdata%2Fef"><font size="2" face="Microsoft YaHei">Entity Framework开发人员中心</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fadonet%2F"><font size="2" face="Microsoft YaHei">Entity Framework团队博客</font></a><font size="2" face="Microsoft YaHei">。至于 Web API，请访问</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.asp.net%2Fweb-api"><font size="2" face="Microsoft YaHei">http://www.asp.net/web-api</font></a><font size="2" face="Microsoft YaHei">。</font></p>

<p><font size="2" face="Microsoft YaHei">希望大家喜欢 ！</font></p>

<p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Ftwitter.com%2Fjlzander"><font size="2" face="Microsoft YaHei"> <i>https://twitter.com/jlzander</i> </font></a><font face="Microsoft YaHei"><font size="2"><i> </i><i>上追随我的脚步 </i></font></font></p>

<p><font size="2" face="Microsoft YaHei"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>介绍"Napa"-Office 365 开发工具</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/napa-office-365</link>
      <pubDate>Tue, 24 Jul 2012 01:40:04 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/07/24/napa-office-365/</guid>
      <description><![CDATA[[原文发表地址]&#160; Introducing “Napa” - Office 365 Development Tools  [原文发表时间]&#160; 2012-07-17 6:00...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址]&#160; </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/07/17/introducing-napa-office-365-development-tools.aspx"><font size="2" face="Microsoft YaHei">Introducing “Napa” - Office 365 Development Tools</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-07-17 6:00</font></p>  <p><font size="2" face="Microsoft YaHei">昨天是Office和 SharePoint令人非常兴奋的一天 ！小组在记者会上公布了新的Office计划，并发布了一个Office和 SharePoint 2013 的公共预览版。您可以在微软新闻中心上找到可用的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fnews%2FPress%2F2012%2FJul12%2F07-16OfficePR.aspx"><font size="2" face="Microsoft YaHei">新闻发布会</font></a><font size="2" face="Microsoft YaHei">，并观看首席执行官Steve Ballmer的视频</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fnews%2Fpresskits%2Foffice%2Fliveevent.aspx"><font size="2" face="Microsoft YaHei">网络广播</font></a><font size="2" face="Microsoft YaHei">。您也可以在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fbit.ly%2FLiHiP4"><font size="2" face="Microsoft YaHei">office.com/preview</font></a><font size="2" face="Microsoft YaHei">下载发布. </font></p>  <p><font size="2" face="Microsoft YaHei">但令人兴奋的事情并不只有这些— — 如果您是一个开发者，您会很高兴听到有关开发Office和 SharePoint 的新方法。</font></p>  <p><font size="2" face="Microsoft YaHei">Office和 SharePoint 2013 以新的云应用程序模型为特色，使用web 标准，并让您可以在Office和 SharePoint内生成一类新的合并了 web 技术和云服务的应用程序。对于Office和 SharePoint 2013 的主要投资之一是云启用。应用程序可寄宿在云端，这使您能够更快地部署、 更新和维护您的应用程序。您也能够发布您的应用程序以及通过一个新的Office存储销售它， 或通过您的组织内部的App Catalog分发IT核准的应用程序。若要了解更多有关新的云应用程序模型和Office存储，我推荐阅读Ludovic Hauduc 的公告和在新的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fofficeapps%2Farchive%2F2012%2F07%2F17%2Fintroducing-the-new-office-cloud-app-model.aspx"><font size="2" face="Microsoft YaHei">Office和 SharePoint 应用程序的博客</font></a><font size="2" face="Microsoft YaHei">观看视频。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>介绍</b><b>&quot;Napa&quot;</b></font></font></p>  <p><font size="2" face="Microsoft YaHei">与昨天的Office和 SharePoint 同步发行版本中，我很高兴地分享我们发布了一个新的工具集，称为&quot;Napa&quot;，它是着手构建新的云应用程序模型应用程序的最简单方法。当我们着手为新的云应用程序模型创建开发工具时，我们重新思考了我们想要为客户提供的总体解决方案。我们想要提供一个轻量级的、浏览器中的体验，那样您可以在一个浏览器中快速构建您的 SharePoint 或Office web 应用程序，而该应用程序也将在同一浏览器中运行。因此，我们创建了一个称为“Napa”的一流开发环境，作为 Visual Studio 的在线联合。</font></p>  <p><font size="2" face="Microsoft YaHei">&quot;Napa&quot;是一个针对SharePoint的免费应用。由于&quot;Napa&quot;是基于 web 的，因此您不需要在您的机器上安装任何东西来开始开发Office和 SharePoint。只需打开您的浏览器来开始编码。随着您的应用程序的成熟，您需要更高级的工具，您可以无缝地切换到更强大、功能全面的Visual Studio IDE，并继续在那里开发。若要了解有关在Visual Studio 2012中针对SharePoint 工具的最新改进的详细信息，请访问</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fee290856(v%3DVS.110).aspx"><font size="2" face="Microsoft YaHei">MSDN</font></a><font size="2" face="Microsoft YaHei">.</font></p>  <p><font size="2" face="Microsoft YaHei">当然，在与&quot;Napa&quot;并行的同时，您仍可以继续使用Office和 SharePoint的现有的可扩展性模型，像 VBA、 COM、 VSTO和 SharePoint 解决方案。（不过，请注意这些不能提交到新的Office存储。）</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>入门教程</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">让我们偷窥一下所有的内容。若要尝试一下&quot;Napa&quot;，首先在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fdev.office.com%2F"><font size="2" face="Microsoft YaHei">http://dev.office.com</font></a><font size="2" face="Microsoft YaHei">注册 Microsoft Office 365 开发者预览.</font></p>  <p><font size="2" face="Microsoft YaHei">当您注册时，将为您创建一个开发者网站。此网站为您提供您自己的Office 365实例，那里您可以开发、 部署和测试您的Office 365 应用程序。</font></p>  <p><font size="2" face="Microsoft YaHei">下一步，您会想要安装&quot;Napa&quot;来将工具添加到您的开发者网站中。</font></p>  <p><font size="2" face="Microsoft YaHei">(请访问</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fapps%2Ffp179924(v%3Doffice.15)"><font size="2" face="Microsoft YaHei">MSDN</font></a><font size="2" face="Microsoft YaHei">来了解关于这些&quot;入门&quot;步骤的完整说明。）</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>创建项目</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">下一步 （已经将&quot;Napa&quot;安装在您的开发者网站上了），请单击&quot; Get tools to build apps &quot;来启动&quot;Napa&quot;。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7026.image_69C5CD23.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7026.image_5F00_69C5CD23.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0763.image_thumb_45343F9F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0763.image_5F00_thumb_5F00_45343F9F.png" width="734" height="378" /></a></p>  <p><font size="2" face="Microsoft YaHei">&quot;Napa&quot;支持构建Office 和SharePoint的所有类型的应用程序，并使您可以在 web 应用程序和Office 应用程序的丰富的客户端版本上（如 Excel、 Word）运行。</font></p>  <p><font size="2" face="Microsoft YaHei">让我们由构建SharePoint应用程序来开始。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4370.image_327F45E8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4370.image_5F00_327F45E8.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2728.image_thumb_26E988A9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2728.image_5F00_thumb_5F00_26E988A9.png" width="729" height="476" /></a></p>  <p><font size="2" face="Microsoft YaHei">选择&quot; App for SharePoint &quot;，然后点击&quot; Create &quot;，您可以在浏览器中为您的应用程序编写代码。</font></p>  <p><font size="2" face="Microsoft YaHei">作为 一名web 开发人员，您首先会注意到的一件事是新的云应用程序模型是基于 web 标准的。您将花些时间来编码HTML，客户端ASPX、 CSS 和 JavaScript。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4061.image_0D81856F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4061.image_5F00_0D81856F.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2728.image_thumb_5F96C367.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2728.image_5F00_thumb_5F00_5F96C367.png" width="734" height="482" /></a></p>  <p><font size="2" face="Microsoft YaHei">即使&quot;Napa&quot;是基于浏览器的应用程序 （适用于所有的现代浏览器），我们想要确保您拥有一个作为一名开发人员您所希望的丰富编辑体验。让我们深入到几项编辑器的关键功能，而您可能不会从基于浏览器的开发人员工具中期望到这些功能。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>读取和编写代码</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">我们希望您能更高效地阅读和编写代码，所以我们在您键入时添加了语法着色、 实例突出、 缩进、 括号匹配和完成。</font></p>  <p><font size="2" face="Microsoft YaHei">例如，当您滚动代码时，您会注意到当您点击一个标识符时，所有实例将在编辑器中突出显示。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8203.clip_image007_7A62E973.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8203.clip_5F00_image007_5F00_7A62E973.png"><img title="clip_image007" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1258.clip_image007_thumb_5CF09867.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1258.clip_5F00_image007_5F00_thumb_5F00_5CF09867.png" width="602" height="372" /></a></p>  <p><font size="2" face="Microsoft YaHei">针对JavaScript 和 CSS的简单、 基于文本的自动完成包括一套丰富的代码片段 （CTRL + 空格键）。例如，我们可以使用for循环片段：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7522.clip_image008_65E02AA6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7522.clip_5F00_image008_5F00_65E02AA6.png"><img title="clip_image008" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3005.clip_image008_thumb_337C5727.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3005.clip_5F00_image008_5F00_thumb_5F00_337C5727.png" width="496" height="174" /></a></p>  <p><font size="2" face="Microsoft YaHei">使用代码段添加for 循环之后，可以通过这些标识符来浏览，并更改它们的名称，如果需要的话。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5875.clip_image009_532B30EF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5875.clip_5F00_image009_5F00_532B30EF.png"><img title="clip_image009" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5468.clip_image009_thumb_4EB4B028.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5468.clip_5F00_image009_5F00_thumb_5F00_4EB4B028.png" width="482" height="120" /></a></p>  <p><font size="2" face="Microsoft YaHei">我们也可以简单地选择常见值，例如JavaScript 和 CSS 中的true/false、 文字等。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5556.clip_image010_5567B9AB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5556.clip_5F00_image010_5F00_5567B9AB.png"><img title="clip_image010" border="0" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1830.clip_image010_thumb_2303E62C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1830.clip_5F00_image010_5F00_thumb_5F00_2303E62C.png" width="531" height="158" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>代码清理</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">为了帮助您整理您的代码，确保其正确性，我们已经为JavaScript 和 CSS添加了查看错误和警告的功能。通过按 (CTRL +，) 来在错误之间导航。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4786.clip_image011_5BAE9039.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4786.clip_5F00_image011_5F00_5BAE9039.png"><img title="clip_image011" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6445.clip_image011_thumb_3069F932.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6445.clip_5F00_image011_5F00_thumb_5F00_3069F932.png" width="275" height="81" /></a></p>  <p><font size="2" face="Microsoft YaHei">我们也根据需要对JavaScript 和 CSS 设置了（CTRL + ALT + F）格式，这允许您选择一个代码块，并整理它。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>代码导航</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">为了帮助您找到您的代码，我们已经添加了查找 (CTRL + F)、 查找/替换 （CTRL + H） 和快速查看代码大纲（CTRL + ALT + O）的功能，如下图所示。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5556.clip_image012_5018D2FA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5556.clip_5F00_image012_5F00_5018D2FA.png"><img title="clip_image012" border="0" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2248.clip_image012_thumb_448315BB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2248.clip_5F00_image012_5F00_thumb_5F00_448315BB.png" width="660" height="416" /></a></p>  <p><font size="2" face="Microsoft YaHei">至于键盘绑定的完整列表，按 (CTRL +.)。这将会出现一个显示了所有的键盘快捷方式的列表页面。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>应用程序属性</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">&quot;Napa&quot;为最常用的设置使用轻量级的设计器，这允许您直观地编辑您的应用程序清单和属性。点击左下角&quot; Properties &quot;图标来打开设计器。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5468.image_66DAAB34.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5468.image_5F00_66DAAB34.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3312.image_thumb_42491DB0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3312.image_5F00_thumb_5F00_42491DB0.png" width="734" height="431" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>运行</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">当您查看 Default.aspx 和 app.js ，您会看到此应用程序是一个简单的页面，字符串显示&quot; initializing….”，在为当前用户信息成功调用一个SharePoint查询之后，更改为了&quot;Hello &lt;username&gt;&quot;，这显示应用程序与 SharePoint结合起来了。</font></p>  <p><font size="2" face="Microsoft YaHei">在左下角，单击run按钮来运行 SharePoint 应用程序。这将打包该应用程序，将它添加到您的开发人员网站中，并在浏览器中打开它。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5554.image_08C60DB9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5554.image_5F00_08C60DB9.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8508.image_thumb_767D46F6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8508.image_5F00_thumb_5F00_767D46F6.png" width="734" height="206" /></a></p>  <p><font size="2" face="Microsoft YaHei">也就是说，不必在客户端机器上安装任何软件，&quot;Napa&quot;也能够让您创建一个项目，编辑该项目，并在 SharePoint Online 上运行它。由于代码都是客户端的，您可以使用您的浏览器的调试工具来调试代码。（例如 Internet Explorer 中的 f12 键)</font></p>  <p><font size="2" face="Microsoft YaHei">我们认为这是在简化开发者的入门上的一个极大飞跃。您不再需要在开发机器上安装软件来创建您的第一个应用程序，尤其是 SharePoint 服务器。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>在</b><b> Visual Studio 2012</b><b>中打开一个副本</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">有些时候，您会想要使用针对Visual Studio 2012的 Microsoft Office 开发人员工具的完整的强大功能。例如，云应用程序模型中关键的新功能之一是应用程序可以由SharePoint、 Windows Azure Web 站点或您自己的 web 服务器承载。Visual Studio 将使您能够修改在&quot;Napa&quot;中启动的项目或从头创建新的应用程序，那样它们可以面向所有的承载选项。您还可以利用Visual Studio 2012中强大的 web 开发功能，如DOM 资源管理器或 JavaScript 调试器。</font></p>  <p><font size="2" face="Microsoft YaHei">为了无缝过渡到Visual Studio，&quot;Napa&quot;将让您不仅可以下载您的项目，而且它还将帮助安装为开发Office和 SharePoint应用程序而所需要的任何软件。</font></p>  <p><font size="2" face="Microsoft YaHei">点击左下角的&quot; Open in VS &quot;按钮。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5468.clip_image017_7206C62F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5468.clip_5F00_image017_5F00_7206C62F.png"><img title="clip_image017" border="0" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2742.clip_image017_thumb_4ACC7CFA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2742.clip_5F00_image017_5F00_thumb_5F00_4ACC7CFA.png" width="252" height="84" /></a></p>  <p><font size="2" face="Microsoft YaHei">首次使用此功能时，如果您将服务器代码元素添加到您的项目中，您将被要求选择 Visual Studio使用的语言首选项。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5140.clip_image018_1868A97B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5140.clip_5F00_image018_5F00_1868A97B.png"><img title="clip_image018" border="0" alt="clip_image018" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0184.clip_image018_thumb_38178343.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0184.clip_5F00_image018_5F00_thumb_5F00_38178343.png" width="455" height="339" /></a></p>  <p><font size="2" face="Microsoft YaHei">当您点击&quot; Continue &quot;时，系统会提示您运行 exe 文件，这将会检查您是否安装Visual Studio 2012、针对 Visual Studio 2012 的Microsoft Office 开发人员工具-预览插件和所有依赖项。如果您不这样做，它将启动 Microsoft Web 平台安装程序来安装所需的软件。它将下载它们，然后在 Visual Studio 2012 中打开该项目。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5468.image_33A1027C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5468.image_5F00_33A1027C.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2742.image_thumb_1A38FF42.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2742.image_5F00_thumb_5F00_1A38FF42.png" width="734" height="77" /></a></p>  <p><font size="2" face="Microsoft YaHei">您会注意到的事情是当您从 Visual Studio 中运行时，该项目将已被设为开发和远程调试到您的开发人员网站中。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5468.image_7CC6AE35.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5468.image_5F00_7CC6AE35.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5140.image_thumb_50A9B144.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5140.image_5F00_thumb_5F00_50A9B144.png" width="734" height="545" /></a></p>  <p><font size="2" face="Microsoft YaHei">至于那些想要由 Visual Studio开始的人来说，直接下载针对Visual Studio 2012 RC的Microsoft Office 开发人员工具—预览版可</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.microsoft.com%2Fweb%2Fhandlers%2FWebPI.ashx%3Fcommand%3DGetInstallerRedirect%26appid%3DOfficeToolsForVS2012RCPreview%26mode%3Dnew"><font size="2" face="Microsoft YaHei">在这里</font></a><font size="2" face="Microsoft YaHei">下载。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>Office </b><b>应用程序</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">既然，我们已经构建了一个SharePoint应用程序，让我们回到&quot;Napa&quot;，然后为Office构建一个应用程序。这一次，当您创建新的项目时，让我们为 Excel选择一个Content应用程序。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3731.image_00D38CB9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3731.image_5F00_00D38CB9.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1261.image_thumb_753DCF79.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1261.image_5F00_thumb_5F00_753DCF79.png" width="733" height="481" /></a></p>  <p><font size="2" face="Microsoft YaHei">默认情况下，Office 应用程序包含 HTML，CSS 和 JavaScript文件，这就强化了Office云应用程序模型是标准的 web 开发的概念。</font></p>  <p><font size="2" face="Microsoft YaHei">这一次，当我们运行应用程序时，我们在Excel Web 应用程序中运行它 — — 无需安装 Microsoft Office 2013 预览版来构建首个Office应用程序。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8524.image_5BD5CC3F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8524.image_5F00_5BD5CC3F.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3480.image_thumb_770E2540.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3480.image_5F00_thumb_5F00_770E2540.png" width="734" height="538" /></a></p>  <p><font size="2" face="Microsoft YaHei">安装它们之后，您可以在 Office 客户端应用程序中运行，这是属性设计器中的一个选项。</font></p>  <p><font size="2" face="Microsoft YaHei">最后，除了SharePoint 应用程序和Excel 应用程序之外，&quot;Napa&quot;还支持创建任务窗格和邮件应用程序。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>了解更多信息</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">本文中我们只是覆盖到了Office和 SharePoint应用程序的皮毛。我建议访问新的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fdev.office.com%2F"><font size="2" face="Microsoft YaHei">Office应用程序和 SharePoint 开发人员中心</font></a><font size="2" face="Microsoft YaHei">来了解更多。别忘了</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fdev.office.com%2F"><font size="2" face="Microsoft YaHei">注册</font></a><font size="2" face="Microsoft YaHei">Microsoft Office 365 开发者预览来尝试一下&quot;Napa&quot;</font></p>  <p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Ftwitter.com%2Fjlzander"><font face="Microsoft YaHei"><font size="2"><i>https://twitter.com/jlzander</i> </font></font></a><font face="Microsoft YaHei"><font size="2"> <i>上追随我的脚步。</i></font></font></p>  <p><font size="2" face="Microsoft YaHei"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>发布针对.NET的Windows Azure SDK（2012年6月）- 现支持Visual Studio 2012 RC 版本</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/netwindows-azure-sdk20126-visual-studio-2012-rc</link>
      <pubDate>Sun, 08 Jul 2012 23:57:27 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/07/08/netwindows-azure-sdk20126-visual-studio-2012-rc/</guid>
      <description><![CDATA[[原文发表地址] Announcing the June 2012 Release of Windows Azure SDK for .NET – Now with Support for...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址] </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/06/07/announcing-the-june-2012-release-of-windows-azure-sdk-for-net-now-with-support-for-visual-studio-2012-rc.aspx"><font size="2" face="Microsoft YaHei">Announcing the June 2012 Release of Windows Azure SDK for .NET – Now with Support for Visual Studio 2012 RC</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间]&#160; 2012-06-07 13:01</font></p>  <p><font size="2" face="Microsoft YaHei">我非常激动地宣布发布针对 .NET的Windows Azure SDK -2012年6月版，可从</font><a href="http://www.windowsazure.com/en-us/develop/net/"><font size="2" face="Microsoft YaHei">这里</font></a><font size="2" face="Microsoft YaHei">立即下载。这个SDK为Visual Studio 2010 SP1 和 Visual Studio 2012 RC提供了工具. 我非常高兴大家一直期待的Visual Studio 2012 可以支持Azure SDK的功能 。。有关今天发布的平台的更多信息，我推荐您访问</font><a href="http://weblogs.asp.net/scottgu/archive/2012/06/07/meet-the-new-windows-azure.aspx"><font size="2" face="Microsoft YaHei">Scott Guthrie的博客</font></a><font size="2" face="Microsoft YaHei">或者来自今天</font><a href="http://www.meetwindowsazure.com/"><font size="2" face="Microsoft YaHei">遇见Windows Azure</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio一直致力于给您提供开发云服务的最佳工具。我们从两个方面着手来实现这一目标。一方面是为Windows Azure应用程序提供高效的工具，这点会在稍后做详细介绍。另一方面是提供应用程序生命周期的管理工具，该工具可以帮助缩短周期和加快部署（请看我之前的博文</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/23/continuous-value-delivery-with-visual-studio-11-alm.aspx"><font size="2" face="Microsoft YaHei">持续值传递</font></a><font size="2" face="Microsoft YaHei">）。今天我们为开发基于云的服务宣布了新功能，包括持续性集成和持续性部署。对于这些新功能，你可以查看你的部属历史记录，并整合它们。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2235.Deployed-Builds-in-TFS-Portal_391F38FC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2235.Deployed_2D00_Builds_2D00_in_2D00_TFS_2D00_Portal_5F00_391F38FC.png"><img title="Deployed Builds in TFS Portal" border="0" alt="Deployed Builds in TFS Portal" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0741.Deployed-Builds-in-TFS-Portal_thumb_545791FD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0741.Deployed_2D00_Builds_2D00_in_2D00_TFS_2D00_Portal_5F00_thumb_5F00_545791FD.png" width="554" height="345" /></a></p>  <p><font size="2" face="Microsoft YaHei">我鼓励您访问</font><a href="http://blogs.msdn.com/b/bharry/archive/2012/06/07/announcing-continuous-deployment-to-azure-with-team-foundation-service.aspx"><font size="2" face="Microsoft YaHei">Brian Harry的博客</font></a><font size="2" face="Microsoft YaHei">，那里对新功能有更进一步的演示。</font></p>  <p><b><font size="3" face="Microsoft YaHei">最新的平台与工具</font></b></p>  <p><font size="2" face="Microsoft YaHei">基于上周的博文</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/31/announcing-the-release-candidate-rc-of-visual-studio-2012-and-net-framework-4-5.aspx"><font size="2" face="Microsoft YaHei">发布Visual Studio 2012 候选版</font></a><font size="2" face="Microsoft YaHei"> ，您可以用VS 2012候选版在本地构建Windows Azure云服务和Windows Azure网站。这遵循了我们的原则：工具的发布需要与平台的发布保持同一步调。您也可以建立解决方案，把Windows Azure项目与您最喜欢的客户端工程结合在一起。您还可以选择您开发机的操作系统，包括Windows7, Windows2008, Windows 8 R2, Windows 8 RP 和 Windows Server 8 RP.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7343.1-mvc4-emulator-iisexpress_321BDC9E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7343.1_2D00_mvc4_2D00_emulator_2D00_iisexpress_5F00_321BDC9E.png"><img title="1-mvc4-emulator-iisexpress" border="0" alt="1-mvc4-emulator-iisexpress" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8836.1-mvc4-emulator-iisexpress_thumb_587DBFE9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8836.1_2D00_mvc4_2D00_emulator_2D00_iisexpress_5F00_thumb_5F00_587DBFE9.png" width="554" height="412" /></a></p>  <p><font size="2" face="Microsoft YaHei">如果您选择的是Visual Studio 2012候选版，您会发现安装Windows Azure SDK是轻量级的. 在一台64位的机器上，安装包大约只有35兆。我们能够做到这一点，是因为Windows Azure SDK 可与精简IIS Express和SQL 2012 LocalDB 开发服务器协同工作，SQL 2012 LocalDB是随VS2012RC发布的(或者包含在供下载的VS 2010 SP1中)。你还会注意到使用这些服务来开发只需少量用户配置或者不需要用户配置，程序会以您当前的登录用户来运行。当前这个版本的工具仍然要求以管理员身份来运行-不过我们的目标是在将来的版本中剔除这一要求。SQL Server Express 和完整的IISServer仍然支持本地开发模式的选项。</font></p>  <p><font size="2" face="Microsoft YaHei">在过去，直接升级Azure SDK 和相关工具是有问题的。这也就是我们为什么要支持本SDK与2011年11月及之后发布的SDK做并排相容的原因。您可以将2011年11月和2012年6月的SDK版本安装到同一台机器上，并且继续使用您项目所需的SDK版本。另外，一个团队中的云开发人员只要安装了匹配的SDK版本，就可以使用Visual studio 2010 SP1或者使用Visual Studio 2012 RC。这些环境都是兼容的。</font></p>  <p><b><font size="3" face="Microsoft YaHei">项目</font></b></p>  <p><font size="2" face="Microsoft YaHei">您将会注意到我们的项目有很多更新。首先就是Windows Azure项目更名为Windows AzureCloud Service，同步于为了无限扩展和多层次服务而更名的计算容器。您仍然可以使用“Add Windows Azure Cloud Service”来继续往现有的Web工程中 添加云服务。Web项目前端可以从本地部署到新的Windows Azure Web Sites Preview容器中。有关更多信息&lt;请看WA 网站上的博文&gt;。</font></p>  <p><font size="2" face="Microsoft YaHei">现在我们创建Azure项目的时候，可以添加最普通的NuGet包和用于云开发的二进制引用，即运行时，诊断，存储和配置。我们为Windows Azure存储特别添加一个NuGet包，为所有新的Windows Azure CloudConfigurationManager类别添加其它包。</font></p>  <p><font size="2" face="Microsoft YaHei">CloudConfigurationManager 使得读取配置文件更加容易，它使用智能算法，首先检查您的云配置文件 (.cscfg)，当配置主键和配置系统无效的时候，回退去检查web.config/app.config文件。我对于这个新的API 感到非常激动，因为它使您只要一行代码就能读取配置信息。你可利用默认情况下最佳的做法，允许dev-op覆盖每个目标环境下的配置。对于云开发者来说NuGet也是一个强大的框架，因为它允许您搜索我们最新版本的Windows Azure 客户端库，以及它允许您在GuGet包管理器中更新通知。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1563.2-CloudConfigurationManager_74224BDF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1563.2_2D00_CloudConfigurationManager_5F00_74224BDF.png"><img title="2-CloudConfigurationManager" border="0" alt="2-CloudConfigurationManager" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4532.2-CloudConfigurationManager_thumb_6D030F67.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4532.2_2D00_CloudConfigurationManager_5F00_thumb_5F00_6D030F67.png" width="554" height="84" /></a></p>  <p><font size="2" face="Microsoft YaHei">SDK中新增了几个项目模板选项. 例如我之前提到的新web模板类型：MVC4和MVC4 Web API.还有两个新的工作角色版本，一个是Worker Role with Service Bus Queue，另一个是Cache Worker Role, 可以优化Windows Azure 服务的角色. Service Bus开发者需要检查Service Bus节点在资源服务器中的新Queues和Topics功能。</font></p>  <p><font size="2" face="Microsoft YaHei">更先进的情况是，我们自定义的文件或者文件夹结构可以跟我们的云服务一起安装到角色当中。这就允许增强定制性，打包部署到你的角色或者虚拟机中。只需简单地右击Azure 项目，选择添加-&gt;项目..或者添加-&gt;文件夹。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>Windows Azure </b><b>虚拟机预览版（</b><b>IAAS</b><b>）</b></font></font></p>  <p><font size="2" face="Microsoft YaHei">Windows Azure 虚拟机预览版提供了强大的新计算容器来运行持续性的虚拟机工作负载。您可以自定义虚机的操作系统和应用程序来高效运行您的工作负载。使用Visual StudioServer Explorer中的云工具，您会发现一些在您部署时会用到的虚拟机重要信息。例如，您可以轻易的检测到您虚拟机的名字和状态，您可以获取域名。扩展开来，您还可以看到所有暴露在特定端口的终端，比如SQL服务器和RDP. 说到RDP，远程桌面是一种很常见的工具，用来配置和在云环境中故障排除环境具体行为。现在您可以在Server Explorer中右击任何一台虚拟机，Web或者worker角色，如果远程桌面协议已经在角色中启用，您可以不离开Visual Studio 而选择“用远程桌面连接”。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2553.3-virtualmachine-serverexplorer-rdp_3D47F799.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2553.3_2D00_virtualmachine_2D00_serverexplorer_2D00_rdp_5F00_3D47F799.png"><img title="3-virtualmachine-serverexplorer-rdp" border="0" alt="3-virtualmachine-serverexplorer-rdp" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8322.3-virtualmachine-serverexplorer-rdp_thumb_0AE4241A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8322.3_2D00_virtualmachine_2D00_serverexplorer_2D00_rdp_5F00_thumb_5F00_0AE4241A.png" width="554" height="371" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>Windows Azure </b><b>缓存预览版</b></font></font></p>  <p><font size="2" face="Microsoft YaHei">这个版本的SDK另一个很酷的功能是，您可以在角色中创建您自己的分布式高速缓存服务，并最终使您的云服务提高速度。这些角色实例可以组成缓存集群来提供高效的分布缓存服务。</font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 使得创建缓存服务变得异常容易。您只要简单地在设计窗口中打开您的角色，在“启用缓存”的选项中打上勾，用滑动条选择缓存容量值和设置一些其它的自定义行为就可以了。这开启了一个激动人心的潜在价值，它可以用来均衡您已付费的角色实例的未使用内存和计算能力。或者您也可以选择使用Dedicated Cache Worker Role模板来创建一个完全用于缓存方案的角色。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5618.4-enable-windows-azure-caching_4AAE0A9F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5618.4_2D00_enable_2D00_windows_2D00_azure_2D00_caching_5F00_4AAE0A9F.png"><img title="4-enable-windows-azure-caching" border="0" alt="4-enable-windows-azure-caching" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7840.4-enable-windows-azure-caching_thumb_011EBCA2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7840.4_2D00_enable_2D00_windows_2D00_azure_2D00_caching_5F00_thumb_5F00_011EBCA2.png" width="554" height="371" /></a></p>  <p><font size="2" face="Microsoft YaHei">使用Windows Azure 缓存预览版 NuGet包来均衡您客户端的缓存是非常容易的。当你添加了工具包，这个包公式化了web.config/app.config的设置以用Windows Azure 代替内存提供商。你只要在配置文件中设置标识符名，让它与角色容器中的缓存匹配即可。然后你就可以使用 Microsoft.ApplicationServer.Caching.* APIs, 或者做一些标准配置来使用ASP.NET缓存，输出缓存或者会话缓存。更多细节在</font><a href="http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/"><font size="2" face="Microsoft YaHei">缓存向导</font></a><font size="2" face="Microsoft YaHei">中描述。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8838.5-consume-cache-in-client_59E4736C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8838.5_2D00_consume_2D00_cache_2D00_in_2D00_client_5F00_59E4736C.png"><img title="5-consume-cache-in-client" border="0" alt="5-consume-cache-in-client" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5127.5-consume-cache-in-client_thumb_2E9FDC65.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5127.5_2D00_consume_2D00_cache_2D00_in_2D00_client_5F00_thumb_5F00_2E9FDC65.png" width="554" height="329" /></a></p>  <p><b><font size="3" face="Microsoft YaHei">发布</font></b></p>  <p><font size="2" face="Microsoft YaHei">本博文讨论的针对.Net 的Windows Azure SDK .Net, 是以2011年6月的SDK为基础提高发展而来的。基于开发者的反馈，我们增加了一些选项。首先，SDK增加了新的部署选项来同步更新实例。这个功能可以加快实例的发布时间，如果此服务的高可用性要求不是那么重要的话（比如在存储环境中）。此功能是采用手动并行更新实例，而不是按照默认的更新框架根据更新域依次执行更新操作。其次，我们决定使用更加安全的默认错误。例如，如果一个更新操作失败了，将不再自动删除该操作， 并且重新尝试新的部署（虽然这个选项在高级操作中仍然可以选择）。最后，有反馈表示在包的编译和发布时段，自动配置用来连接诊断和缓存的字段是不透明的。开发者更希望在项目中这个配置能够更加明确和透明。因此我们现在用明确的一次性字符串符号来代替存储连接字段。这个符号直接写在项目的.cscfg文件中，可以让您完全控制和可见。您也可以选择不启用这个行为或者在任何需要的时候改变连接字符串。所有您对目标环境的发布操作和云配置设置都可以保存在一个或者多个配置文件中。</font></p>  <p><font size="2" face="Microsoft YaHei">对于业务应用程序开发者使用Visual Studio LightSwitch来说, 您将会看到对发布 LightSwitch应用程序到Window Azure中的改进的体验。这包括通过下载您的发布设置文件和执行您的所有新部署及部署更新来持续性体验精简配置。为LightSwitch提供SDK工具与Visual Studio LightSwitch 成为Visual Studio 专业版及更高版本的核心部分保持同步。更多信息请访问</font><a href="http://blogs.msdn.com/b/lightswitch/archive/2012/06/07/publishing-lightswitch-apps-to-azure-with-visual-studio-2012.aspx"><font size="2" face="Microsoft YaHei">LightSwitch小组博客</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><b><font size="3" face="Microsoft YaHei">总结</font></b></p>  <p><font size="2" face="Microsoft YaHei">就像您看到的，这是对开发云应用工具的一个重大更新。我们期待您能使用该SDK并且给我们反馈。更多的开发资源的详细信息请访问</font><a href="http://www.windowsazure.com/en-us/develop/net/"><font size="2" face="Microsoft YaHei">Windows Azure .NET 开发人员中心</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font size="2" face="Microsoft YaHei">望您喜欢！</font></p>  <p><font size="2" face="Microsoft YaHei">请继续关注我 </font><a href="https://twitter.com/#!/jlzander"><font size="2" face="Microsoft YaHei">twitter.com/jlzander</font></a><font size="2" face="Microsoft YaHei">.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>在ARM（WOA）上开发Windows时，你应该知道的事情</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/armwoawindows</link>
      <pubDate>Tue, 03 Jul 2012 02:44:45 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/07/03/armwoawindows/</guid>
      <description><![CDATA[[原文发表地址] What you need to know about developing for Windows on ARM (WOA)  [原文发表时间] 2012-06-12 5:40...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址] </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/06/12/what-you-need-to-know-about-developing-for-windows-on-arm-woa.aspx"><font size="2" face="Microsoft YaHei">What you need to know about developing for Windows on ARM (WOA)</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间] 2012-06-12 5:40 AM</font></p>  <p><font size="2" face="Microsoft YaHei">你可能已经听说了，ARM PC 上的新 Windows将与 Windows 8一起上市。如果你一直关注</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fnorthamerica.msteched.com%2F"><font size="2" face="Microsoft YaHei">北美TechEd</font></a><font face="Microsoft YaHei"><font size="2"><s>的</s>所涵盖的内容，那么你在主题演讲中已经看到这些设备了。在这篇文章中，我们将要涉及到<s>这</s>对开发人员意味的所有东西。</font></font></p>  <p><font size="2" face="Microsoft YaHei">有关 ARM中的Windows介绍，我推荐阅读Steven Sinofsky 的发表有关 Windows 8&quot;的博客：</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fb8%2Farchive%2F2012%2F02%2F09%2Fbuilding-windows-for-the-arm-processor-architecture.aspx"><font size="2" face="Microsoft YaHei">构建针对 ARM 处理器体结构的Windows</font></a><font size="2" face="Microsoft YaHei">。正如Steven所提到的， 目前ARM测试设备对小型协作程序是可用的。但是今天，所有的开发人员都可以开始准备他们针对ARM PC的Metro样式应用程序。</font></p>  <p><font size="2" face="Microsoft YaHei">在这篇帖子中，我将演示开发一个可以在ARM PC上运行的应用程序。你将发现在ARM中开发Windows应用程序与在x 86/64 PC上开发Metro样式应用程序一样 ；也就是说，相同的Metro样式应用程序将可以在任何硬件上运行。另外，很多你从创建其他应用程序类型 （设计、 测试、 调试等） 中知道的Visual Studio 范式将会传递到你构建Metro样式应用程序的体验中。除了下面的演练，我还录制了一个</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fchannel9.msdn.com%2Fposts%2FDeveloping-For-Windows-on-ARM"><font size="2" face="Microsoft YaHei">视频</font></a><font size="2" face="Microsoft YaHei">，那样您可以看到这些实际操作：</font></p> <iframe style="width: 512px; height: 288px;" src="https://channel9.msdn.com/posts/Developing-For-Windows-on-ARM/player?w=512&amp;h=288" frameborder="0" scrolling="no"></iframe>  <p>&#160;</p>  <p><font size="2" face="Microsoft YaHei">随着多年来 Windows 硬件的发展，我们一直在更新了 Visual Studio来帮助您构建面向每个版本的应用程序。例如，今天你可以使用 Visual Studio来构建在 x86 和 x 64 PC上运行的应用程序。您还可以使用 Visual Studio来构建在ARM硬件上运行的应用程序，其中包括 Windows Phone 和 Windows Embedded Compact。在 Windows 8中，您现在将能够构建针对ARM的Windows应用程序。（澄清一点，Visual Studio 本身将不会在ARM上运行，但它将能够让您构建在ARM设备上运行的应用程序）。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>演练</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">让我们来看看在 Visual Studio 2012 中构建这些应用程序会是什么样的。不管你正在使用 JavaScript、 C + +、 Visual Basic，还是 C#，如果您已经构建了一个面向 x 86/x 64的Metro样式应用程序，那么你已经知道如何构建面向 ARM的应用程序了。您可以使用相同的Metro样式项目模板，此模板为构建应用程序提供了起始点。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0385.image5_15E5E9CD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0385.image5_5F00_15E5E9CD.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4572.image5_thumb_65526C14.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4572.image5_5F00_thumb_5F00_65526C14.png" width="704" height="488" /></a></p>  <p><font size="2" face="Microsoft YaHei">在此例中，我们将从使用 Windows Blog Reader应用程序来开始，并演示调试流程、 测试和在ARM设备上部署它的过程。您可以找到创建此应用程序（</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fapps%2Fxaml%2Fhh974582.aspx"><font size="2" face="Microsoft YaHei">JavaScript</font></a><font size="2" face="Microsoft YaHei">， </font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fapps%2Fxaml%2Fbr211380.aspx"><font size="2" face="Microsoft YaHei">C# /VB</font></a><font size="2" face="Microsoft YaHei">，或</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fapps%2Fxaml%2Fhh465045.aspx"><font size="2" face="Microsoft YaHei">C+ +</font></a><font size="2" face="Microsoft YaHei">）的教程. </font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2021.TutorialImage_5BF93791.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2021.TutorialImage_5F00_5BF93791.png"><img title="TutorialImage" border="0" alt="TutorialImage" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5810.TutorialImage_thumb_59530C91.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5810.TutorialImage_5F00_thumb_5F00_59530C91.png" width="700" height="522" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>远程调试</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 提供了远程调试的功能。当与 ARM 设备一起使用时，您需要使用此功能，因为 Visual Studio总是运行在 x 86 / x 64机器上。在你开始远程调试之前，您需要在你的ARM设备中安装</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.microsoft.com%2Fvisualstudio%2F11%2Fen-us%2Fdownloads%23remote-tools"><font size="2" face="Microsoft YaHei">针对Visual Studio 2012 RC的远程工具</font></a><font size="2" face="Microsoft YaHei">。我们要做的第一件事是从设备的Start屏幕中启动Remote Debugger。您可能会收到一个提示来自动配置防火墙设置 （点击Configure以继续）。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2086.RemoteDebugger_46A0A38B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2086.RemoteDebugger_5F00_46A0A38B.png"><img title="RemoteDebugger" border="0" alt="RemoteDebugger" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3247.RemoteDebugger_thumb_61D8FC8C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3247.RemoteDebugger_5F00_thumb_5F00_61D8FC8C.png" width="638" height="130" /></a></p>  <p><font size="2" face="Microsoft YaHei">下一步从工具栏中选择“Remote Machine”</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8424.DebugMenu_75F21915.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8424.DebugMenu_5F00_75F21915.png"><img title="DebugMenu" border="0" alt="DebugMenu" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3225.DebugMenu_thumb_1849AE8F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3225.DebugMenu_5F00_thumb_5F00_1849AE8F.png" width="190" height="145" /></a></p>  <p><font size="2" face="Microsoft YaHei">（注： 如果您使用c + +，你还需要点击Debug下拉列表，并选择Configuration Manager，然后将平台设置为&quot;ARM&quot;。）Visual Studio 2012 将会弹出Remote Debugger Connections对话框。如果设备是位于同一子网，那么该设备将显示在&quot; My Subnet &quot;下 （或者如果您是通过项目属性窗口来做的，单击Debug选项卡下的&quot;Find…&quot;按钮）。另外您也可以通过输入设备的计算机名称或 IP 地址来手动配置它。选择您的机器，如果系统提示的话，就输入您的登录凭据（这要视乎您所选择的身份验证模式）。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4885.image_33BD919C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4885.image_5F00_33BD919C.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1346.image_thumb_5A8BA7DC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1346.image_5F00_thumb_5F00_5A8BA7DC.png" width="409" height="513" /></a></p>  <p><font size="2" face="Microsoft YaHei">下一步，你会在你的ARM设备上看到一个获取</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fapps%2Fhh696646(v%3Dvs.110).aspx"><font size="2" face="Microsoft YaHei">开发人员许可</font></a><font size="2" face="Microsoft YaHei">证的提示:</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0763.image_5D34638D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0763.image_5F00_5D34638D.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2248.image_thumb_4AEB9CCB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2248.image_5F00_thumb_5F00_4AEB9CCB.png" width="411" height="300" /></a></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 将打包和部署您的应用程序，然后在ARM设备上启动它。实现这一切需要在MSBuild、编译器、打包向导中做一些事情，但这一切明显地发生了，并允许您只集中于构建你的应用程序。</font></p>  <p><font size="2" face="Microsoft YaHei">此时，你实际上添加了一台远程调试器！让我们设置一个断点，那样我们可以看到调试器的操作行为。要执行此操作，请按 Shift + F5 来停止调试，并打开 DateConverter.cs 文件。在Convert方法的第一行上设置一个断点，然后再次按 F5。（JavaScript将断点设在在 data.js 文件的getBlogPosts 函数上， C+ + 将断点设置在 DateConverter.h的Convert方法上）。</font></p>  <p><font size="2" face="Microsoft YaHei">您将看到执行程序在断点处停下来了，你能拥有完整的调试器功能 （即Stepping, Breakpoints, Locals, Watches, Call Stack, Immediate Window等）。请特别注意Registers窗口，它支持ARM ，并能帮助您查看事情是如何在设备上运行的。现在，您可以按 f11 键以继续进入该方法，然后按 Shift + F5 停止调试。</font></p>  <p><font size="2" face="Microsoft YaHei">C#：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0576.CSharpStoppedInDebugger_57A7621F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0576.CSharpStoppedInDebugger_5F00_57A7621F.png"><img title="CSharpStoppedInDebugger" border="0" alt="CSharpStoppedInDebugger" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2625.CSharpStoppedInDebugger_thumb_09356066.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2625.CSharpStoppedInDebugger_5F00_thumb_5F00_09356066.png" width="704" height="427" /></a></p>  <p><font size="2" face="Microsoft YaHei">C + +:</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5140.image40_58384069.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5140.image40_5F00_58384069.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0763.image40_thumb_2CAEB273.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0763.image40_5F00_thumb_5F00_2CAEB273.png" width="704" height="427" /></a></p>  <p><font size="2" face="Microsoft YaHei">JavaScript:</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5100.image45_631F6475.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5100.image45_5F00_631F6475.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3022.image45_thumb_1D3352B7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3022.image45_5F00_thumb_5F00_1D3352B7.png" width="704" height="427" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>单元测试</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">让我们来看看如何为我们的应用程序添加单元测试，并在ARM设备上执行它们。右击解决方案，然后单击&quot;Add-&gt; New Project &quot;，然后选择&quot; Unit Test Library（Metro style apps）&quot;模板。将项目命名为&quot;BlogReaderUnitTestLibrary&quot;，然后单击确定。</font></p>  <p><font size="2" face="Microsoft YaHei">右击References，并选择&quot; Add Reference…&quot;，然后单击&quot; Solution &quot;，并选择&quot;WindowsBlogReader&quot;。使用下面的代码来更新 UnitTest1.cs：</font></p>  <div id="codeSnippetWrapper">   <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"><font size="2" face="Microsoft YaHei">[TestClass]<br /><span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> UnitTest1<br />{<br />    <br />    [TestMethod]<br />    <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">void</span> ValidateConvertForYearWithValidInput()<br />    {<br />        var converterInstance = <span style="color: rgb(0, 0, 255);">new</span> DateConverter();<br /><br />        <span style="color: rgb(0, 128, 0);">//checks if Convert method returns the year properly.</span><br />        DateTime currentTime = DateTime.Now;<br />        <span style="color: rgb(0, 0, 255);">string</span> actualYear = <br />            (<span style="color: rgb(0, 0, 255);">string</span>)converterInstance.Convert((<span style="color: rgb(0, 0, 255);">object</span>)currentTime, <br />                                              <span style="color: rgb(0, 0, 255);">typeof</span>(<span style="color: rgb(0, 0, 255);">string</span>), <span style="color: rgb(0, 96, 128);">&quot;year&quot;</span>, <span style="color: rgb(0, 96, 128);">&quot;Invariant&quot;</span>);<br />        <span style="color: rgb(0, 0, 255);">string</span> expectedYear = DateTime.Now.Year.ToString();<br />        Assert.AreEqual(expectedYear, actualYear, <br />        <span style="color: rgb(0, 96, 128);">&quot;The expected year to be returned by the Convert method and the actual returned value are not equal&quot;</span>);<br />    }<br /><br />    [TestMethod]<br />    <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">void</span> ValidateConvertWithInvalidInput()<br />    {<br />        var converterInstance = <span style="color: rgb(0, 0, 255);">new</span> DateConverter();<br /><br />        <span style="color: rgb(0, 128, 0);">//checks if Convert method throws exception when invoked with a string input.</span><br />        <span style="color: rgb(0, 0, 255);">string</span> currentTimeSTring = DateTime.Now.ToString();<br /><br />        Assert.ThrowsException&lt;ArgumentException&gt;(() =&gt; <br />            (<span style="color: rgb(0, 0, 255);">string</span>)converterInstance.Convert((<span style="color: rgb(0, 0, 255);">object</span>)currentTimeSTring, <br />                                              <span style="color: rgb(0, 0, 255);">typeof</span>(<span style="color: rgb(0, 0, 255);">string</span>), <br />                                              <span style="color: rgb(0, 96, 128);">&quot;year&quot;</span>, <br />                                              <span style="color: rgb(0, 96, 128);">&quot;Invariant&quot;</span>),<br />            <span style="color: rgb(0, 96, 128);">&quot;Invoking Convert with a non-DateTime type doesn't throw&quot;</span>);<br />    }<br />}<br /></font></pre>&#160;&#160; <br /></div>

<p><font size="2" face="Microsoft YaHei">类似地，C+ + 有一个针对Metro样式应用程序的单元测试库模板。需要注意的一个关键区别是 C + + 单元测试是针对 WinMD 文件运行的，而不是针对 EXE 项目的，所以在本演练的例子中， DateConverter.h 将需要被移动到一个单独的库项目中，然后被编译为 WinMD。有关如何</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fapps%2Fhh441482(v%3Dvs.110).aspx"><font size="2" face="Microsoft YaHei">对Metro样式应用程序进行单元测试</font></a><font size="2" face="Microsoft YaHei">的详细信息，请访问Windows 开发中心.</font></p>

<p><font size="2" face="Microsoft YaHei">通过点击Test -&gt; Windows-&gt; Test Explorer，我们可以使用新的Test Explorer来启动我们的测试。（注意这将在您的 Visual Studio 机器上运行测试，而不是在ARM设备上）。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8836.TestExplorer_2AF48B94.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8836.TestExplorer_5F00_2AF48B94.png"><img title="TestExplorer" border="0" alt="TestExplorer" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1586.TestExplorer_thumb_03BA425F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1586.TestExplorer_5F00_thumb_5F00_03BA425F.png" width="300" height="350" /></a></p>

<p><font size="2" face="Microsoft YaHei">我们之前安装的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fwww.microsoft.com%2Fvisualstudio%2F11%2Fen-us%2Fdownloads%23remote-tools"><font size="2" face="Microsoft YaHei">针对Visual Studio 2012 RC的远程工具</font></a><font size="2" face="Microsoft YaHei">包括一个命令行的单元测试运行器（vstest.console.exe）。我们可以用它来在ARM设备上执行我们的测试，它支持.trx 文件的脱机预览和共享结果（注意 ARM中不支持JavaScript 单元测试）。让我们通过从测试项目中创建一个 AppX 包来开始 （右键单击项目，单击Store -&gt; Create AppX package）。按照提示，选择&quot;ARM&quot;作为您要构建的软件包类型。现在将 AppX 软件包复制到设备中 （可以在这里使用USB）。从命令提示符中更改到此目录：</font></p>

<p><font size="2" face="Microsoft YaHei">%ProgramFiles%\Microsoft Visual Studio\11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow</font></p>

<p><font size="2" face="Microsoft YaHei">运行以下命令来安装AppX证书：</font></p>

<p><font size="2" face="Microsoft YaHei">certutil –addstore root BlogReaderUnitTestLibrary_1.0.0.0_ARM_Debug.cer</font></p>

<p><font size="2" face="Microsoft YaHei">现在，键入以下命令：</font></p>

<p><font size="2" face="Microsoft YaHei">vstest.console.exe BlogReaderUnitTestLibrary_1.0.0.0_ARM_Debug.appx /logger:trx</font></p>

<p><font size="2" face="Microsoft YaHei">/Logger:trx switch创建了一个 trx 文件，它可以用于详地细分析结果。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7658.image55_6C33A209.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7658.image55_5F00_6C33A209.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3326.image55_thumb_5C276403.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3326.image55_5F00_thumb_5F00_5C276403.png" width="673" height="347" /></a></p>

<p><font face="Microsoft YaHei"><font size="3"><b>手动测试</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">你可以在Microsoft Test Manager的帮助之下，在ARM设备上执行手动测试方案。如果要执行这项操作，在你的 x 86 / x 64 机器上运行 Microsoft Test Manager，并连接到你的远程设备。在您测试时，您记录的 bug 会从所连接的ARM设备上收集所有诊断信息。你可以直接从您的主机中截取设备的截图，并自动在TFS中创建bug。</font></p>

<p><font size="2" face="Microsoft YaHei">让我们来看看实际操作。在您的设备中启动Microsoft Test Tools Adapter 服务，此服务是负责收集诊断信息的：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7612.TestToolsAdapter_66E74C09.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7612.TestToolsAdapter_5F00_66E74C09.png"><img title="TestToolsAdapter" border="0" alt="TestToolsAdapter" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8360.TestToolsAdapter_thumb_2ABE1112.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8360.TestToolsAdapter_5F00_thumb_5F00_2ABE1112.png" width="446" height="338" /></a></p>

<p><font size="2" face="Microsoft YaHei">单击“Start Service”：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8372.TestToolsAdapter2_6FC08CDE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8372.TestToolsAdapter2_5F00_6FC08CDE.png"><img title="TestToolsAdapter2" border="0" alt="TestToolsAdapter2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1425.TestToolsAdapter2_thumb_58951260.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1425.TestToolsAdapter2_5F00_thumb_5F00_58951260.png" width="470" height="197" /></a></p>

<p><font size="2" face="Microsoft YaHei">从您的主机中启动 Microsoft Test Manager，然后转到您的&quot;Test&quot;中心 （假设我们已经创建了测试计划和测试用例）：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3225.image66_1328F450.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3225.image66_5F00_1328F450.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6518.image66_thumb_111A9806.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6518.image66_5F00_thumb_5F00_111A9806.png" width="702" height="135" /></a></p>

<p><font size="2" face="Microsoft YaHei">点击&quot; Modify &quot;链接：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8816.image_65A25920.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8816.image_5F00_65A25920.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3618.image_thumb_3A5DC219.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3618.image_5F00_thumb_5F00_3A5DC219.png" width="376" height="48" /></a></p>

<p><font size="2" face="Microsoft YaHei">最后，输入你想要连接到的远程设备的名称：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6014.ManualTestingRemoteDevice_60F34D42.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6014.ManualTestingRemoteDevice_5F00_60F34D42.png"><img title="ManualTestingRemoteDevice" border="0" alt="ManualTestingRemoteDevice" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2476.ManualTestingRemoteDevice_thumb_7C2BA643.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2476.ManualTestingRemoteDevice_5F00_thumb_5F00_7C2BA643.png" width="502" height="208" /></a></p>

<p><font size="2" face="Microsoft YaHei">您还可以使用&quot; Install Windows metro style App &quot;链接来选择安装你的WindowsBlogReader 应用程序到测试中心的远程设备中。单击工具栏中的&quot;Run&quot;来启动手动测试会话。您将在设备上看到一条弹出的消息，它指示您的手动测试会话已经开始了。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2705.RecordingStarted_507ADC47.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2705.RecordingStarted_5F00_507ADC47.png"><img title="RecordingStarted" border="0" alt="RecordingStarted" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4034.RecordingStarted_thumb_04AF058E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4034.RecordingStarted_5F00_thumb_5F00_04AF058E.png" width="386" height="92" /></a></p>

<p><font size="2" face="Microsoft YaHei">现在你可以执行单个的测试案例，将它们标记为成功或失败，并且记录的bug会直接从设备中捕获丰富的诊断信息。</font></p>

<p><font face="Microsoft YaHei"><font size="3"><b>远程性能分析</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">由于其各自的功率和大小的目标不同，与典型的开发机器相比，WOA和 SoC 设备有不同的 CPU、 内存和 I/O 子系统特征。性能测试将帮助优化任何你所需的事情在任何设备上构建一流的应用程序以供您的用户使用。</font></p>

<p><font size="2" face="Microsoft YaHei">让我们来看看如何设置远程性能分析来分析应用程序的性能。点击Debug -&gt; Start Performance Analysis。您将看到一个检查远程计算机的 UAC 提示 （名为 VSPerf.exe 的程序）。在ARM设备上接受提升权限提示，应用程序将在远程设备上部署和运行性能分析。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3113.image_713AA710.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3113.image_5F00_713AA710.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6740.image_thumb_1808BD51.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6740.image_5F00_thumb_5F00_1808BD51.png" width="554" height="416" /></a></p>

<p><font size="2" face="Microsoft YaHei">现在已经添加了探查器，你可以执行您的方案：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7411.image_3ED6D391.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7411.image_5F00_3ED6D391.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8081.image_thumb_09CA4461.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8081.image_5F00_thumb_5F00_09CA4461.png" width="356" height="153" /></a></p>

<p><font size="2" face="Microsoft YaHei">一旦你使用完了此应用程序，请点击Stop profiling。然后这将复制报告到您的开发机器中，并在 Visual Studio 中打开它。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7183.ProfilerSummary_6DEFBE04.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7183.ProfilerSummary_5F00_6DEFBE04.png"><img title="ProfilerSummary" border="0" alt="ProfilerSummary" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4760.ProfilerSummary_thumb_2891F9DF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4760.ProfilerSummary_5F00_thumb_5F00_2891F9DF.png" width="704" height="427" /></a></p>

<p><font size="2" face="Microsoft YaHei">您可以以各种各样的方式来调查结果 — — 可以放大图像来查看特定时间范围内的结果，您可以使用摘要页面来快速查看选定的时间范围中最昂贵的部件是什么，您可以深入调用树的分支和它们的耗资。这里是Call Tree视图：</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2273.ProfilerCallTree_04914AA5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2273.ProfilerCallTree_5F00_04914AA5.png"><img title="ProfilerCallTree" border="0" alt="ProfilerCallTree" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6864.ProfilerCallTree_thumb_20C6B4E5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6864.ProfilerCallTree_5F00_thumb_5F00_20C6B4E5.png" width="704" height="211" /></a></p>

<p><font size="2" face="Microsoft YaHei">Function Details视图让你以可视化表示形式来查看调用了您所感兴趣的方法的方法的耗资，以及它调用的方法的崩溃和该方法本身中每一行代码的耗资。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0083.ProfilerFunctionDetails_7D994A32.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0083.ProfilerFunctionDetails_5F00_7D994A32.png"><img title="ProfilerFunctionDetails" border="0" alt="ProfilerFunctionDetails" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1541.ProfilerFunctionDetails_thumb_4A5FA17A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1541.ProfilerFunctionDetails_5F00_thumb_5F00_4A5FA17A.png" width="704" height="428" /></a></p>

<p><font size="2" face="Microsoft YaHei">此外值得注意的是远程性能分析支持暂停和继续功能，就像本地性能分析一样。</font></p>

<p><font face="Microsoft YaHei"><font size="3"><b>打包你的应用程序</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">当你将你的应用程序上传到存储区时，如果你的应用程序只有托管代码 （C#，VB，JavaScript），您可以构建一个&quot;Neutral&quot;软件包。这表示该软件包包含了将在 x 86、 x 64 或ARM中运行的代码。若要创建软件包，右键单击项目，然后选择Store -&gt; Create App Package。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2112.image111_551F8980.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2112.image111_5F00_551F8980.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0121.image111_thumb_604BA47B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0121.image111_5F00_thumb_5F00_604BA47B.png" width="704" height="543" /></a></p>

<p><font size="2" face="Microsoft YaHei">如果您既有本机代码，也有托管代码，你将需要为你支持的每个体系结构构建一个软件包，包括 ARM。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4857.image120_76A149C0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4857.image120_5F00_76A149C0.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2337.image120_thumb_38A7B902.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2337.image120_5F00_thumb_5F00_38A7B902.png" width="704" height="544" /></a></p>

<p><font size="2" face="Microsoft YaHei">在上传之前，在实际的ARM设备上运行Windows App Certification Kit(WinACK)是一个好的想法，它可以验证所有的事物在目标环境中都是按预期进行的。在Visual Studio 2012 RC中，我们提供了一个单个的 MSI，其中包括了你在ARM设备上安装它所需要的一切，那样事情变得更简单了。您可以通过下载</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Fwindows%2Fhardware%2Fhh852363"><font size="2" face="Microsoft YaHei"> 针对 Windows 8 发布预览的Windows 软件开发工具包 (SDK)</font></a><font size="2" face="Microsoft YaHei">来获取此 MSI。安装此 SDK 之后，您将在C:\Users\ &lt;user&gt; \Downloads\Windows Kits\8.0\StandaloneSDK\Installers下看到一个称为&quot;Windows App Certification Kit arm_en-us.msi&quot;的文件。只需将该文件复制到您的ARM设备中，并在那里运行它。</font></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3718.image126_0BB77789.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3718.image126_5F00_0BB77789.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1234.image126_thumb_765C52D1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1234.image126_5F00_thumb_5F00_765C52D1.png" width="604" height="424" /></a></p>

<p><font face="Microsoft YaHei"><font size="3"><b>结论</b><b></b></font></font></p>

<p><font size="2" face="Microsoft YaHei">在这篇文章中，我们演示了在ARM上开发一个Metro样式应用程序来在Windows 上运行的过程。我们看到，将您的Metro样式应用程序指向ARM，其中只有很少的差异。我们涵盖到了一些您需要知道的特定提示，例如，如何在设备上做远程调试和性能分析。我希望这篇文章可以帮助解答一些您的问题，并帮助您准备开发在ARM上运行的 Windows应用程序。</font></p>

<p><font size="2" face="Microsoft YaHei">希望大家喜欢 ！</font></p>

<p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="https://twitter.com/jlzander"><i><font size="2" face="Microsoft YaHei">twitter.com/jlzander</font></i></a><i><font size="2" face="Microsoft YaHei">上追随我的脚步。</font></i></p>]]></content:encoded>
    </item>
    <item>
      <title>来自欧洲TechEd 大会的现场： LightSwitch HTML 客户端预览和针对SharePoint 的Visual Studio 2012工具</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/teched-lightswitch-html-sharepoint-visual-studi</link>
      <pubDate>Tue, 26 Jun 2012 01:55:24 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/06/26/teched-lightswitch-html-sharepoint-visual-studi/</guid>
      <description><![CDATA[[原文发表地址] Live from TechEd Europe: LightSwitch HTML Client Preview and Visual Studio 2012 Tools for...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址] </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/06/26/live-from-teched-europe-lightswitch-html-client-preview-and-visual-studio-2012-tools-for-sharepoint.aspx"><font size="2" face="Microsoft YaHei">Live from TechEd Europe: LightSwitch HTML Client Preview and Visual Studio 2012 Tools for SharePoint</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间] 2012-06-26 12:40 </font></p>  <p><font size="2" face="Microsoft YaHei">今天早上我在阿姆斯特丹的</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Feurope.msteched.com%2F"><font size="2" face="Microsoft YaHei">TechEd Europe 2012</font></a><font size="2" face="Microsoft YaHei"> 大会上做了主题演讲，并分享了一些我们的工具的更新。如果你没有亲自参加该事件，你仍然可以在网上观看。你可以通过</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fchannel9.msdn.com%2F"><font size="2" face="Microsoft YaHei">第 9 频道</font></a><font size="2" face="Microsoft YaHei">观看主题演讲的实时流，这个视频将会根据需要被公布到</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fchannel9.msdn.com%2FEvents%2FTechEd%2FEurope%2F2012"><font size="2" face="Microsoft YaHei">TechEd Europe 2012事件页面上</font></a>。</p>  <p><font size="2" face="Microsoft YaHei">你可能听说的首个宣布是我们的 LightSwitch HTML 客户端预览版本...</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>LightSwitch HTML </b><b>客户端预览的可用性</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">在</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2F2012%2F06%2F11%2Fteched-north-america-2012-keynote-recap.aspx"><font size="2" face="Microsoft YaHei">TechEd 北美 2012</font></a><font size="2" face="Microsoft YaHei">中，我展示了LightSwitch 如何支持HTML5、 JavaScript 和 CSS，因此您可以构建在多个设备运行的以触摸中心的应用程序。此方法能让您使用跨应用程序相同的后端服务的优势和 LightSwitch 的高效。</font></p>  <p><font size="2" face="Microsoft YaHei">我们很高兴宣布 LightSwitch HTML 客户端预览将于今天晚些时候对</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkID%3D207267"><font size="2" face="Microsoft YaHei">MSDN 订阅者</font></a><font size="2" face="Microsoft YaHei"> 是可用的（一旦该安装程序是可用的，我将更新此篇文章，），并将在 6 月 28 日 （星期四）公开！若要了解有关此版本的更多信息，提供反馈意见，或提问，请访问 LightSwitch</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flightswitch%2Fhtmlclient"><font size="2" face="Microsoft YaHei">开发人员中心</font></a><font size="2" face="Microsoft YaHei">、</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Flightswitch%2F"><font size="2" face="Microsoft YaHei">团队博客</font></a><font size="2" face="Microsoft YaHei">和</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2Flightswitchhtml%2Fthreads"><font size="2" face="Microsoft YaHei">论坛</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>针对</b><b>SharePoint 2010 </b><b>的</b><b> </b><b>Visual Studio 2012 </b><b>工具</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">今天上午我也演示了 SharePoint工具。在 Visual Studio 2012 RC中，我们为编写SharePoint 2010 解决方案而推出了另一个令人信服的发布。我们为创建 SharePoint 列表和内容类型开发了丰富的体验，那样您不再需要处理复杂的架构或出错的手动编辑的 XML。我们新的 SharePoint List Designer允许您以可视方式和准确地定义新的列表和内容类型：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5661.sptools_5391475E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5661.sptools_5F00_5391475E.png"><img title="sptools" border="0" alt="sptools" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8461.sptools_thumb_1C78EC95.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8461.sptools_5F00_thumb_5F00_1C78EC95.png" width="704" height="450" /></a></p>  <p><font size="2" face="Microsoft YaHei">我们也正在努力确保您在使用 SharePoint 解决方案时获取最准确的IntelliSense。当开发一个</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fee361616(v%3Dvs.110)"><font size="2" face="Microsoft YaHei">沙盒解决方案</font></a><font size="2" face="Microsoft YaHei">时，现在我们筛选出可在产品中使用的 API，那样您能得到适合使用的 API的即时反馈。我们也已经增强IntelliSense来解析存储在 SharePoint 内容数据库中的JavaScript 文件，并且现在为这些文件中的功能和成员提供IntelliSense。</font></p>  <p><font size="2" face="Microsoft YaHei">Visual Studio 2012 RC 包括几项针对Office 365开发的增强功能，在Office 365 中，SharePoint 解决方案在沙盒的进程中运行。例如，Visual Web Part模板已更新为可与沙盒兼容，现在可被安全地部署到Office 365。如果您更喜欢在 XAML 中定义您的 Web Part的话，我们还推出了一个新的 Silverlight Web Part模板。最后，我们改善了体验，在部署沙盒解决方案时，有一个新的发布对话框，它允许您直接发布到Office 365 或任何其他远程的 SharePoint Server。</font></p>  <p><font size="2" face="Microsoft YaHei">在Visual Studio 2012 RC中，针对SharePoint 开发的ALM 支持继续得到了改善。我们已经扩展了我们的性能分析支持，那样您可以获得有关</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fee361616(v%3Dvs.110)"><font size="2" face="Microsoft YaHei">场和沙盒</font></a><font size="2" face="Microsoft YaHei">解决方案中的瓶颈的丰富信息。正如我之前</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fblogs.msdn.com%2Fb%2Fjasonz%2Farchive%2F2012%2F03%2F27%2Fvisual-studio-ultimate-roadmap.aspx"><font size="2" face="Microsoft YaHei">宣布</font></a><font size="2" face="Microsoft YaHei">的，我们会在第一个Ultimate功能包中继续添加 ALM 的支持，这将支持单元测试以及SharePoint 负载测试。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>结论</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">我期待着聆讯你们的信息，也期望你们有机会尝试这些功能。</font></p>  <p><font size="2" face="Microsoft YaHei">享受这一事件吧，并确保签出</font><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Fchannel9.msdn.com%2FEvents%2FTechEd%2FEurope%2F2012"><font size="2" face="Microsoft YaHei">查看在线视频</font></a><font size="2" face="Microsoft YaHei"> ！</font></p>  <p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=zh-CHS&amp;a=http%3A%2F%2Ftwitter.com%2Fjlzander"><font size="2" face="Microsoft YaHei"> <i>twitter.com/jlzander</i> </font></a><i><font size="2" face="Microsoft YaHei">上追随我的脚步。</font></i></p>  <p><font size="2" face="Microsoft YaHei">&#160;</font></p>  <p><font size="2" face="Microsoft YaHei"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>我最喜爱的功能： VS 11 中单元测试的增强功能</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_zander/vs-11</link>
      <pubDate>Mon, 18 Jun 2012 18:35:50 GMT</pubDate>
      <dc:creator><![CDATA[DevDivChina]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.cloudplatform.qa.msdn.wdslab.com/jason_zander/2012/06/18/vs-11/</guid>
      <description><![CDATA[[原文发表地址] My Favorite Features: Unit Testing Enhancements in Visual Studio 11  [原文发表时间] 2012-05-23...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Microsoft YaHei">[原文发表地址] </font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/22/my-favorite-features-unit-testing-enhancements-in-visual-studio-11.aspx"><font size="2" face="Microsoft YaHei">My Favorite Features: Unit Testing Enhancements in Visual Studio 11</font></a></p>  <p><font size="2" face="Microsoft YaHei">[原文发表时间] 2012-05-23 0:40</font></p>  <p><font size="2" face="Microsoft YaHei">我正在撰写一系列博文，它是关于我个人在开发时我最喜爱的 Visual Studio 11 中的功能。在我的</font><a href="http://blogs.msdn.com/b/jasonz/archive/2012/05/10/my-favorite-features-improved-tooling-in-visual-studio-11-for-javascript-developers.aspx"><font size="2" face="Microsoft YaHei">最近的一篇博文中</font></a><font size="2" face="Microsoft YaHei">，我谈到了 JavaScript 工具的增强功能。在这篇文章中，我想谈一谈单元测试的新功能。单元测试是开发过程中一个重要的步骤，是我们整个Visual Studio团队都在做的事情。在我个人的编码项目工作时，我也在编写单元测试。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>第三方测试框架</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">那些对单元测试充满激情的开发人员会经常告诉你为什么他们最喜爱的框架是最好的。在 Visual Studio 11中，我们想为他们提供一流、 专注于开发人员的体验，那样他们可以使用任何他们想要的框架。若想要将单元测试框架添加到你的开发环境中，只需安装来自 Visual Studio 扩展管理器（如下图所示）的插件 或在线</font><a href="http://visualstudiogallery.msdn.microsoft.com/"><font size="2" face="Microsoft YaHei">Visual Studio 库</font></a><font size="2" face="Microsoft YaHei">。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4174.image_50B72363.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4174.image_5F00_50B72363.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0755.image_thumb_576A2CE6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0755.image_5F00_thumb_5F00_576A2CE6.png" width="554" height="357" /></a></p>  <p><font size="2" face="Microsoft YaHei">在这一点上有许多可用的测试框架插件，其中包括：</font></p>  <ul>   <li><font size="2" face="Microsoft YaHei">NUnit</font></li>    <li><font size="2" face="Microsoft YaHei">xUnit.net</font></li>    <li><font size="2" face="Microsoft YaHei">MbUnit</font></li>    <li><font size="2" face="Microsoft YaHei">Qunit</font></li>    <li><font size="2" face="Microsoft YaHei">Jasmine</font></li> </ul>  <p><font size="2" face="Microsoft YaHei">当然我们还有内置的针对.NET 代码的&quot;MS -Test&quot;测试框架，以及一个针对c + + 代码的新框架。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>使用</b><b>Nunit</b><b>编写测试</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">让我们看一个</font><a href="http://www.nunit.org/"><font size="2" face="Microsoft YaHei">NUnit</font></a><font size="2" face="Microsoft YaHei">的示例。NUnit 团队在</font><a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx"><font size="2" face="Microsoft YaHei">测试版发布的同一天</font></a><font size="2" face="Microsoft YaHei">推出了一个针对 Visual Studio 11 Beta的适配器，最近还发布了一些重要bug 修复的更新。你可以</font><a href="http://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d"><font size="2" face="Microsoft YaHei">在这里</font></a><font size="2" face="Microsoft YaHei">安装Visual Studio 11 Beta的 NUnit 测试适配器，着手使用它就如同安装它一样简单。</font></p>  <p><font size="2" face="Microsoft YaHei">在此示例中，我使用的是一个测试项目，它是一个引用了Nunit.Frameework.dll的.NET Class Library 。这儿有一个Nunit的一个快速测试来显示它是如何运作的。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/4338.image_1A8C3299.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/4338.image_5F00_1A8C3299.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/0131.image_thumb_456496AB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/0131.image_5F00_thumb_5F00_456496AB.png" width="554" height="325" /></a></p>  <p><font size="2" face="Microsoft YaHei">然后点击单元测试资源管理器窗口中的“运行所有”，并查看结果。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7612.clip_image005_287A6D15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7612.clip_5F00_image005_5F00_287A6D15.png"><img title="clip_image005" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2806.clip_image005_thumb_4F488355.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2806.clip_5F00_image005_5F00_thumb_5F00_4F488355.png" width="277" height="461" /></a></p>  <p><font size="2" face="Microsoft YaHei">能够使用不同的第三方单元测试框架，甚至在单个解决方案中混合使用它们是多年来我们的客户的重大要求。现在你可以轻松地扩展你的体验来让你的团队使用他们所喜欢的单元测试引擎。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>持续地运行测试</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">当你在编写测试和代码，并在中间的每个步骤运行测试时，你可能会发现不断地来回切换有点乏味。在 Visual Studio 11中，现在你可以配置测试资源管理器来在构建完每个成功的生成之后自动地运行单元测试。这真的很省时，因为它使测试运行起来感觉是该生成的一部分。</font></p>  <p><font size="2" face="Microsoft YaHei">将你的单元测试认作为生成的一部分是件很自然的事情。很长时间以来，团队已经使用持续集成服务器来为每个签入构建和运行测试。现在，你可以在你的本地计算机上获得相同的结果。</font></p>  <p><font size="2" face="Microsoft YaHei">若要打开它，只需切换到测试资源管理器工具栏中的&quot;生成后运行测试&quot;选项。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7608.clip_image007_2403EC4E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7608.clip_5F00_image007_5F00_2403EC4E.png"><img title="clip_image007" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5226.clip_image007_thumb_35E0801B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5226.clip_5F00_image007_5F00_thumb_5F00_35E0801B.png" width="297" height="332" /></a></p>  <p><font size="2" face="Microsoft YaHei">此功能很不错的是它让你集中在代码上，而不是在Visual Studio 中的其他工具窗口。只有出现失败时，你才会停下来看看周围，看看发生了什么事。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>调试测试时出错</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">当某个测试失败时，有几种方法可以找出问题所在。首先，你可以查看测试runner，它提供了丰富的异常信息。如果信息不够充足的话，使用调试器来查看测试是非常有用的。在 Visual Studio 11中，你可以以调试其他托管测试的相同方式来调试NUnit 测试。为此，只需右击测试管理器中的测试，并选择&quot;调试选定的测试&quot;。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/3005.clip_image009_2397B959.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/3005.clip_5F00_image009_5F00_2397B959.png"><img title="clip_image009" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8284.clip_image009_thumb_2A4AC2DC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8284.clip_5F00_image009_5F00_thumb_5F00_2A4AC2DC.png" width="478" height="344" /></a></p>  <p><font face="Microsoft YaHei"><font size="3"><b>分析我的测试结果</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">对于单元测试，你可能想要执行很多分析，人们最常用的是代码覆盖率。我们大大简化了为单元测试而所需收集代码覆盖率信息的体验，并使它能够与第三方单元测试项目一起使用。正如下图所示，让我们选择测试管理器中的&quot;分析代码覆盖率&quot;。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1325.clip_image011_30FDCC5F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1325.clip_5F00_image011_5F00_30FDCC5F.png"><img title="clip_image011" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/2818.clip_image011_thumb_1EB5059D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/2818.clip_5F00_image011_5F00_thumb_5F00_1EB5059D.png" width="458" height="353" /></a></p>  <p><font size="2" face="Microsoft YaHei">现在，当运行结束后，它将打开 Visual Studio 代码覆盖率结果窗口，并突出显示了编辑器，这样我可以轻松地确定哪些地方可能需要更多测试覆盖率。</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6646.image_39F7DBDA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6646.image_5F00_39F7DBDA.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/1854.image_thumb_40AAE55D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/1854.image_5F00_thumb_5F00_40AAE55D.png" width="554" height="430" /></a></p>  <p><font size="2" face="Microsoft YaHei">通过右击你所想要分析的测试，然后选择&quot;分析代码覆盖率&quot;，你也可以轻松地查看一个测试 （或一组测试） 的覆盖率。将测试添加到现有的代码中时，这是很方便的。着色的区域让你看到你的代码的哪些部分完全由测试覆盖到了。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>单元测试基于浏览器的</b><b> Javascript</b></font></font></p>  <p><font size="2" face="Microsoft YaHei">我最近的一部分应用程序是基于浏览器的，并使用了很多Visual Studio 11中ASP .NET MVC 推出的新东西。如果你想要单元测试Javascript，你可以一起使用</font><a href="http://qunitjs.com/"><font size="2" face="Microsoft YaHei">QUnit</font></a><font size="2" face="Microsoft YaHei"> （</font><a href="http://docs.jquery.com/QUnit"><font size="2" face="Microsoft YaHei"> JQuery使用 的</font></a><font size="2" face="Microsoft YaHei">单元测试框架） 和</font><a href="http://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe"><font size="2" face="Microsoft YaHei">Visual Studio 库上可用的Chutzpah适配器</font></a><font size="2" face="Microsoft YaHei">.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/7215.image_754B4198.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/7215.image_5F00_754B4198.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/8304.image_thumb_0727D566.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/8304.image_5F00_thumb_5F00_0727D566.png" width="554" height="357" /></a></p>  <p><font size="2" face="Microsoft YaHei">正如你所看到的， QUnit 测试被找到和执行了，它与其他的单元测试有着相同的体验。VS 11 单元测试的可扩展性支持另外的单元测试框架，像 Qunit一样简单地获取 （或编写）一个合适的插件来支持该系统。</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>单元测试本机</b><b> c + + </b><b>应用程序</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">如前所述，随着框中推出了新的 c + + 单元测试框架，我们也能够在 Visual Studio 11 中做本机的单元测试。我们真的很高兴为我们的 c + + 开发人员启用此支持，那样你不再需要使用&quot;/ clr&quot;标记，或回退到第三方框架。</font></p>  <p><font size="2" face="Microsoft YaHei">下面是一个简单的例子：</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/6131.clip_image0027_46F1BBEB.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/6131.clip_5F00_image0027_5F00_46F1BBEB.jpg"><img title="clip_image002[7]" border="0" alt="clip_image002[7]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/15/metablogapi/5557.clip_image0027_thumb_34A8F529.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-15-metablogapi/5557.clip_5F00_image0027_5F00_thumb_5F00_34A8F529.jpg" width="554" height="339" /></a></p>  <p><font size="2" face="Microsoft YaHei">对于一个完整的示例应用程序来说，我建议签出Patterns &amp; Practices团队的</font><a href="http://hilo.codeplex.com/"><font size="2" face="Microsoft YaHei">Hilo项目</font></a><font size="2" face="Microsoft YaHei">，现在包括本机 c + + 单元测试。</font></p>  <p><font size="2" face="Microsoft YaHei">若要了解有关Visual Studio 11中本机单元测试的更多信息，请访问</font><a href="https://aka.ms/vs11-unit-testing-native-code"><font size="2" face="Microsoft YaHei">MSDN</font></a><font size="2" face="Microsoft YaHei">.</font></p>  <p><font face="Microsoft YaHei"><font size="3"><b>结论</b><b></b></font></font></p>  <p><font size="2" face="Microsoft YaHei">在这篇文章中，我们预览了单元测试的一系列新改进。这些侧重于几个关键的客户目标：</font></p>  <p><font size="2" face="Microsoft YaHei">1.灵活性 — —使用任何你的团队偏好的测试框架</font></p>  <p><font size="2" face="Microsoft YaHei">2.简洁和一致性 — — 获取简单、 一致的体验，使开发人员聚焦于他们的工作</font></p>  <p><font size="2" face="Microsoft YaHei">我希望你将有机会尝试Visual Studio 11中新的单元测试功能。至于有关详细信息，请访问</font><a href="http://msdn.microsoft.com/en-us/library/dd264975(v=vs.110)"><font size="2" face="Microsoft YaHei">MSDN</font></a><font size="2" face="Microsoft YaHei">.</font></p>  <p><font size="2" face="Microsoft YaHei">希望大家喜欢 ！</font></p>  <p><i><font size="2" face="Microsoft YaHei">在</font></i><a href="https://twitter.com/jlzander"><font size="2" face="Microsoft YaHei"> <i>twitter.com/jlzander</i> </font></a><i><font size="2" face="Microsoft YaHei">上追随我的脚步</font></i></p>]]></content:encoded>
    </item>
  </channel>
</rss>