{"id":253,"date":"2023-09-08T14:07:21","date_gmt":"2023-09-08T06:07:21","guid":{"rendered":"https:\/\/www.666818.xyz\/?p=253"},"modified":"2023-09-08T14:07:22","modified_gmt":"2023-09-08T06:07:22","slug":"net-framwork%e8%bf%81%e7%a7%bb-net-core-%e5%85%b7%e4%bd%93%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/www.wkv.cc\/index.php\/2023\/09\/08\/net-framwork%e8%bf%81%e7%a7%bb-net-core-%e5%85%b7%e4%bd%93%e6%93%8d%e4%bd%9c\/","title":{"rendered":".net framwork\u8fc1\u79fb.net core \u5177\u4f53\u64cd\u4f5c"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1\u3001\u68c0\u67e5 .NET Framework \u5e94\u7528\u7684\u517c\u5bb9\u6027<\/h2>\n\n\n\n<p>\u5728\u5f00\u59cb\u8fc1\u79fb\u4e4b\u524d\uff0c\u9700\u8981\u5148\u68c0\u67e5 .NET Framework \u5e94\u7528\u662f\u5426\u517c\u5bb9 .NET Core\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c .NET \u56e2\u961f\u5f00\u53d1\u7684\u517c\u5bb9\u6027\u5206\u6790\u5de5\u5177\u6765\u5b9e\u73b0\u3002\u8be5\u5de5\u5177\u80fd\u591f\u5206\u6790 .NET Framework \u5e94\u7528\u7684\u4ee3\u7801\u3001\u4f9d\u8d56\u9879\u548c\u9879\u76ee\u6587\u4ef6\uff0c\u68c0\u6d4b\u5176\u5728 .NET Core \u4e2d\u7684\u517c\u5bb9\u6027\uff0c\u5e76\u751f\u6210\u8fc1\u79fb\u62a5\u544a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2\u3001\u5c06\u9879\u76ee\u6587\u4ef6\u4ece .csproj \u6216 .vbproj \u8f6c\u6362\u4e3a .csproj \u6216 .vbproj<\/h2>\n\n\n\n<p>.NET Core \u4f7f\u7528\u4e0d\u540c\u7684\u9879\u76ee\u6587\u4ef6\u683c\u5f0f\uff08.csproj \u6216 .vbproj\uff09\uff0c\u8fd9\u4e9b\u9879\u76ee\u6587\u4ef6\u9700\u8981\u4ece .NET Framework \u7684\u9879\u76ee\u6587\u4ef6\u683c\u5f0f\uff08.csproj \u6216 .vbproj\uff09\u8f6c\u6362\u8fc7\u6765\u3002\u4e3a\u6b64\uff0c\u53ef\u4ee5\u4f7f\u7528 .NET Core \u7684\u547d\u4ee4\u884c\u5de5\u5177 dotnet migrate \u547d\u4ee4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3\u3001\u66f4\u65b0\u4ee3\u7801\u4e2d\u7684\u547d\u540d\u7a7a\u95f4<\/h2>\n\n\n\n<p>\u7531\u4e8e .NET Framework \u548c .NET Core \u6709\u4e00\u4e9b\u547d\u540d\u7a7a\u95f4\u7684\u5dee\u5f02\uff0c\u56e0\u6b64\u9700\u8981\u66f4\u65b0\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u547d\u540d\u7a7a\u95f4\u3002\u4f8b\u5982\uff0cSystem.Web \u547d\u540d\u7a7a\u95f4\u662f .NET Framework \u7684\u4e00\u90e8\u5206\uff0c\u4f46\u5728 .NET Core \u4e2d\u5df2\u7ecf\u88ab\u5220\u9664\u3002\u9700\u8981\u5c06\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684 System.Web \u547d\u540d\u7a7a\u95f4\u66ff\u6362\u4e3a .NET Core \u4e2d\u7684\u76f8\u5e94\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4\u3001\u68c0\u67e5\u4f9d\u8d56\u9879<\/h2>\n\n\n\n<p>\u9700\u8981\u68c0\u67e5\u5f53\u524d\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6240\u4f9d\u8d56\u7684\u5404\u4e2a\u5305\u548c\u7ec4\u4ef6\u662f\u5426\u5728 .NET Core \u4e2d\u6709\u53ef\u7528\u7684\u66ff\u4ee3\u54c1\u3002\u53ef\u4ee5\u4f7f\u7528 NuGet \u5305\u7ba1\u7406\u5668\u6765\u641c\u7d22\u5e76\u5b89\u88c5\u6240\u9700\u7684 NuGet \u5305\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5\u3001\u66f4\u6539 API \u8c03\u7528<\/h2>\n\n\n\n<p>\u7531\u4e8e\u5e73\u53f0\u4e4b\u95f4\u7684\u5dee\u5f02\u548c API \u53d8\u5316\uff0c\u4e00\u4e9b API \u8c03\u7528\u53ef\u80fd\u9700\u8981\u5728\u8fc1\u79fb\u8fc7\u7a0b\u4e2d\u8fdb\u884c\u66f4\u6539\u3002\u4f8b\u5982\uff0c\u4ece .NET Framework \u5230 .NET Core\uff0cAppDomain.CurrentDomain.BaseDirectory \u8fd9\u4e2a\u65b9\u6cd5\u5728 .NET Core \u4e2d\u5e76\u4e0d\u63a8\u8350\u4f7f\u7528\uff0c\u9700\u8981\u6539\u4e3a\u4f7f\u7528 IHostingEnvironment\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6\u3001\u6d4b\u8bd5\u548c\u8c03\u8bd5\u8fc1\u79fb\u540e\u7684\u5e94\u7528\u7a0b\u5e8f<\/h2>\n\n\n\n<p>\u786e\u5b9a\u8fc1\u79fb\u540e\u7684\u5e94\u7528\u7a0b\u5e8f\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u73af\u5883\u4e0a\u90fd\u80fd\u6b63\u786e\u8fd0\u884c\u3002\u53ef\u4ee5\u4f7f\u7528 .NET Core \u547d\u4ee4\u884c\u5de5\u5177\u6765\u7f16\u8bd1\u3001\u8fd0\u884c\u548c\u6d4b\u8bd5\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>\u5173\u4e8e\u5177\u4f53\u7684\u64cd\u4f5c\uff0c\u5efa\u8bae\u53ef\u4ee5\u67e5\u770b .NET Core \u5b98\u65b9\u6587\u6863\uff0c\u91cc\u9762\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u8fc1\u79fb .NET Framework \u5e94\u7528\u7a0b\u5e8f\u5230 .NET Core\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u68c0\u67e5 .NET Framework \u5e94\u7528\u7684\u517c\u5bb9\u6027 \u5728\u5f00\u59cb\u8fc1\u79fb\u4e4b\u524d\uff0c\u9700\u8981\u5148\u68c0\u67e5 .NET Framework [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[23],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-biancheng","tag-net"],"_links":{"self":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":1,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":254,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/253\/revisions\/254"}],"wp:attachment":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}