You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
25 KiB
HTML

12 months ago
<!doctype html>
<html lang="en" dir="ltr" class="blog-wrapper blog-post-page plugin-blog plugin-id-default" data-has-hydrated="false">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.0.0">
<title data-rh="true">4. .NET 6 Preview 6 尝鲜 | Furion</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="http://furion.baiqian.ltd/blog/net6-preview6"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="4. .NET 6 Preview 6 尝鲜 | Furion"><meta data-rh="true" name="description" content="2021 年 07 月 15 日,微软发布了 .NET 6 Preview 6 版本Furion 在当天第一时间适配了该版本,并发布 Furion v3.0.0-rc.1 版本。"><meta data-rh="true" property="og:description" content="2021 年 07 月 15 日,微软发布了 .NET 6 Preview 6 版本Furion 在当天第一时间适配了该版本,并发布 Furion v3.0.0-rc.1 版本。"><meta data-rh="true" property="og:type" content="article"><meta data-rh="true" property="article:published_time" content="2021-07-15T00:00:00.000Z"><meta data-rh="true" property="article:author" content="https://gitee.com/dotnetchina"><meta data-rh="true" property="article:tag" content="furion,furos,.net,.netcore,.net5,.net6"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="http://furion.baiqian.ltd/blog/net6-preview6"><link data-rh="true" rel="alternate" href="http://furion.baiqian.ltd/blog/net6-preview6" hreflang="en"><link data-rh="true" rel="alternate" href="http://furion.baiqian.ltd/blog/net6-preview6" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Furion RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Furion Atom Feed"><link rel="stylesheet" href="/assets/css/styles.3f87a095.css">
<script src="/assets/js/runtime~main.89709a83.js" defer="defer"></script>
<script src="/assets/js/main.10e5dc01.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const a=new URLSearchParams(window.location.search).entries();for(var[t,e]of a)if(t.startsWith("docusaurus-data-")){var n=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(n,e)}}catch(t){}}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())</script><div id="__docusaurus"><div class="floatbar_hUWl"><div class="qrcode_sWwE"><img title="微信扫码关注 Furion 官方公众号" src="/img/weixin_qrcode.jpg" style="display:block"><div>❤️ 关注 Furion 微信公众号有惊喜哦!</div></div><div style="display:flex;flex-direction:row-reverse;align-items:flex-start"><div class="title_SD0k">🫠 遇到问题了</div><div class="extend__5i1"><a class="item_Y35a" href="/docs/subscribe"><div style="flex:1"><div class="itemTitle_If_T">⭐️ VIP 服务 ⭐️</div><div class="itemDesc_dp7r">仅需 499 元/年,尊享 365 天项目无忧</div></div><div class="jiantou_mV_o"></div></a><div class="item_Y35a"><div style="flex:1"><div class="itemTitle_If_T">问题反馈</div><div class="itemDesc_dp7r">到 Furion 开源仓库反馈</div></div><div class="jiantou_mV_o"></div></div></div></div></div><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><div class="announcementBar_mb4j" style="background-color:#4623d9;color:yellow" role="banner"><div class="content_knG7 announcementBarContent_xLdY">⭐️ 开通 VIP 服务仅需 499 元/年,尊享 365 天项目无忧 <a href="/docs/subscribe" style="background-color:rgb(199, 29, 36);color:#ffffff;padding:1px 10px;border-radius:3px;text-decoration:none;display:inline-block;margin:0 5px;font-size:12px;cursor:pointer;">立即开通</a>⭐️</div></div><nav aria-label="Main" class="navbar navbar--fixed-top navbarHideable_m1mJ"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/furionlogo.png" alt="Furion Logo" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/furionlogo.png" alt="Furion Logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div><b class="navbar__title text--truncate">Furion</b></a><a class="navbar__item navbar__link" href="/docs/category/appendix">文档</a><a class="navbar__item navbar__link" href="/docs/global/app">静态类</a><a class="navbar__item navbar__link" href="/docs/settings/appsettings">配置</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">博客</a><div class="navbar__item dropdown dropdown--hoverable"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">更新日志</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/upgrade">📝 查看日志v4.9.1.7</a></li><li><a class="dropdown__link" href="/docs/target">🚀 路线图</a></li></ul></div><a href="http://furion.baiqian.ltd/api/api" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">API<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></div><div class="navbar__items navbar__it
<p><a href="https://gitee.com/dotnetchina/Furion/tree/3.0.0-rc.1/" target="_blank" rel="noopener noreferrer">Furion .NET 6 Preview 6 源码地址</a></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="安装-net-6-preview-6-sdk">安装 <code>.NET 6 Preview 6 SDK</code><a href="#安装-net-6-preview-6-sdk" class="hash-link" aria-label="Direct link to 安装-net-6-preview-6-sdk" title="Direct link to 安装-net-6-preview-6-sdk"></a></h2>
<p>尝鲜之前,首先先安装 <code>.NET 6 Preview 6 SDK</code>,下载地址:<a href="https://dotnet.microsoft.com/download/dotnet/6.0" target="_blank" rel="noopener noreferrer">https://dotnet.microsoft.com/download/dotnet/6.0</a></p>
<p>下载对应系统和处理器版本即可。</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="旧项目升级">旧项目升级<a href="#旧项目升级" class="hash-link" aria-label="Direct link to 旧项目升级" title="Direct link to 旧项目升级"></a></h2>
<p>编辑所有 <code>.csproj</code> 项目,修改 <code>&lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;</code><code>&lt;TargetFramework&gt;net6.0&lt;/TargetFramework&gt;</code></p>
<p>同时升级所有 <code>Microsoft</code><code>Furion</code> 包为最新版本,<code>Furion</code> 最新版本为:<code>v3.0.0-rc.1</code></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="新项目使用">新项目使用<a href="#新项目使用" class="hash-link" aria-label="Direct link to 新项目使用" title="Direct link to 新项目使用"></a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="升级-visual-studio-2019">升级 <code>Visual Studio 2019</code><a href="#升级-visual-studio-2019" class="hash-link" aria-label="Direct link to 升级-visual-studio-2019" title="Direct link to 升级-visual-studio-2019"></a></h3>
<p>目前 <code>.NET 6 Preview 6</code> 支持使用 <code>Visual Studio 2019 Preview 16.11.0 Preview 3.0</code> 版本,<strong>注意是 <code>Preview</code> 最新版本</strong>。下载地址:<a href="https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=enterprise&amp;ch=pre&amp;rel=16" target="_blank" rel="noopener noreferrer">https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=enterprise&amp;ch=pre&amp;rel=16</a></p>
<p>已经安装了 <code>Visual Studio 2019 Preview</code> 版本的朋友直接升级到最新版即可。</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>特别说明</div><div class="admonitionContent_BuS1"><p>如果使用 <code>Visual Studio Code</code> 开发,可忽略此选项。</p></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="第一个例子">第一个例子<a href="#第一个例子" class="hash-link" aria-label="Direct link to 第一个例子" title="Direct link to 第一个例子"></a></h3>
<p><code>Furion v3.0.0-rc.1</code> 目前提供了所有类型的脚手架,版本号统一 <code>3.0.0-rc.1</code></p>
<p>安装脚手架,打开 <code>CMD/Powershell</code> 执行以下命令:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv codeBlockLinesWithNumbering_o6Pm"><span class="token-line codeLine_lJS_" style="color:#bfc7d5"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">dotnet new --install Furion.Template.Api::3.0.0-rc.1</span></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>创建项目</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv codeBlockLinesWithNumbering_o6Pm"><span class="token-line codeLine_lJS_" style="color:#bfc7d5"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">dotnet new furionapi -n FurionNET6</span></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="打开并启动项目">打开并启动项目<a href="#打开并启动项目" class="hash-link" aria-label="Direct link to 打开并启动项目" title="Direct link to 打开并启动项目"></a></h3>
<p>打开浏览器查看效果即可。</p></div><footer class="row docusaurus-mt-lg blogPostFooterDetailsFull_mRVl"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/furion">furion</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/furos">furos</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/net">.net</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/netcore">.netcore</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/net-5">.net5</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/net-6">.net6</a></li></ul></div><div class="col margin-top--sm"><a href="https://gitee.com/dotnetchina/Furion/tree/v4/handbook/blog/2021-07-15-net6-preview6.mdx" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Blog post page navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/blog/console"><div class="pagination-nav__sublabel">Newer Post</div><div class="pagination-nav__label">5. 在控制台中使用</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/blog/net6-preview5"><div class="pagination-nav__sublabel">Older Post</div><div class="pagination-nav__label">3. .NET 6 Preview 5 尝鲜</div></a></nav></main><div class="col col--2"><div class="tableOfContents_jeP5 thin-scrollbar"><div style="margin:0.5em;display:block;border-bottom:1px solid #dedede;padding-bottom:0.2em;clear:both"><a href="https://www.crmeb.com/?from=furion" target="_blank" title="CRMEB 专注开源电商系统研发" style="display:block;position:relative;align-items:center;box-sizing:border-box;margin-bottom:0.5em;border:2px solid rgb(255, 176, 46)"><img src="/img/crmeb-right.jpg" style="display:block;width:100%" loading="lazy"><span style="position:absolute;z-index:10;top:-16px;right:-8px">👑</span><span style="position:absolute;display:block;right:0;bottom:0;z-index:5;font-size:12px;background-color:rgba(0,0,0,0.8);padding:0 5px">铂金</span></a></div><a href="https://gitee.com/dotnetchina" target="_blank" style="display:block;position:relative" title="了解 dotNET China 组织"><img src="/img/chinadotnet.png" style="display:block;width:90%;margin:0 auto"></a><ul class="table-of-contents table-of-contents__left-border"><li><a href="#安装-net-6-preview-6-sdk" class="table-of-contents__link toc-highlight">安装 <code>.NET 6 Preview 6 SDK</code></a></li><li><a href="#旧项目升级" class="table-of-contents__link toc-highlight">旧项目升级</a></li><li><a href="#新项目使用" class="table-of-contents__link toc-highlight">新项目使用</a><ul><li><a href="#升级-visual-studio-2019" class="table-of-contents__link toc-highlight">升级 <code>Visual Studio 2019</code></a></li><li><a href="#第一个例子" class="table-of-contents__link toc-highlight">第一个例子</a></li><li><a href="#打开并启动项目" class="table-of-contents__link toc-highlight">打开并启动项目</a></li></ul></li></ul></div></div></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">文档</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/category/getstart">入门</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/category/appendix">手册</a></li></ul></div><div class="col footer__col"><div class="footer__title">社区</div><ul class="footer__items clean-list"><li class="fo
</body>
</html>