1. <small id='nh2YA'></small><noframes id='nh2YA'>

    <tfoot id='nh2YA'></tfoot>
      <i id='nh2YA'><tr id='nh2YA'><dt id='nh2YA'><q id='nh2YA'><span id='nh2YA'><b id='nh2YA'><form id='nh2YA'><ins id='nh2YA'></ins><ul id='nh2YA'></ul><sub id='nh2YA'></sub></form><legend id='nh2YA'></legend><bdo id='nh2YA'><pre id='nh2YA'><center id='nh2YA'></center></pre></bdo></b><th id='nh2YA'></th></span></q></dt></tr></i><div id='nh2YA'><tfoot id='nh2YA'></tfoot><dl id='nh2YA'><fieldset id='nh2YA'></fieldset></dl></div>

        <bdo id='nh2YA'></bdo><ul id='nh2YA'></ul>
    1. <legend id='nh2YA'><style id='nh2YA'><dir id='nh2YA'><q id='nh2YA'></q></dir></style></legend>

      如何在 ASP.NET Core 1.0 中获取 bin 文件夹

      时间:2023-06-08
    2. <legend id='sHPX5'><style id='sHPX5'><dir id='sHPX5'><q id='sHPX5'></q></dir></style></legend>

      <i id='sHPX5'><tr id='sHPX5'><dt id='sHPX5'><q id='sHPX5'><span id='sHPX5'><b id='sHPX5'><form id='sHPX5'><ins id='sHPX5'></ins><ul id='sHPX5'></ul><sub id='sHPX5'></sub></form><legend id='sHPX5'></legend><bdo id='sHPX5'><pre id='sHPX5'><center id='sHPX5'></center></pre></bdo></b><th id='sHPX5'></th></span></q></dt></tr></i><div id='sHPX5'><tfoot id='sHPX5'></tfoot><dl id='sHPX5'><fieldset id='sHPX5'></fieldset></dl></div>
      • <bdo id='sHPX5'></bdo><ul id='sHPX5'></ul>
        <tfoot id='sHPX5'></tfoot>

              <tbody id='sHPX5'></tbody>
              • <small id='sHPX5'></small><noframes id='sHPX5'>

              • 本文介绍了如何在 ASP.NET Core 1.0 中获取 bin 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在 asp.net core 1.0 中添加了很多功能.但是没有办法获得 Bin 文件夹路径.

                With asp.net core 1.0 There are lots of functionality added. But there is not way to get Bin Folder path.

                谁能知道我们如何获取 asp.net core 1.0 应用程序的 bin 文件夹路径.

                Can anyone please know how we can get the bin folder path for asp.net core 1.0 application.

                推荐答案

                好吧,bin 文件夹确实存在,但它被移动到解决方案文件旁边的 artifacts 文件夹.由于 ASP.NET Core RC 1 编译内存中的所有内容,您会发现空的 bin 文件夹.但是如果你将生成时生成输出"选项设置为 true(右键单击项目文件 -> 属性和生成选项卡),那么你会在 bin 文件夹中找到生成的文件.

                Well, the bin folder does exists but it is moved to artifacts folder next to the solution file. Since ASP.NET Core RC 1 compiles everything in memory, you will find empty bin folder. But if you set "Produce output on build" option to true (Right click Project file -> Properties and Build tab) then you will find the generated files in bin folder.

                我不认为有任何直接属性可用于获取此路径,但您可以使用@Nikolay Kostov 指出的相同解决方案来获取应用程序路径.然后使用 System.IO 类跳转到 bin 文件夹.

                I don't think so there is any direct property available as to get the path of this but you can use the same solution pointed out by @Nikolay Kostov to get application path. And then using System.IO classes jump to bin folder.

                代码已更新至此处提到的 ASP.NET Core.

                http://www.talkingdotnet.com/get-application-wwwroot-path-aspnet-core-rc2/

                public Startup(IHostingEnvironment env, IApplicationEnvironment appenv)
                {
                     string sAppPath = env.ContentRootPath;
                     string sRootPath = Path.GetFullPath(Path.Combine(sAppPath, @"...."));
                     string sBinFolderPath = @"artifactsin" + appenv.ApplicationName;
                     string sBinPath = Path.Combine(sRootPath, sBinFolderPath);
                }
                

                这篇关于如何在 ASP.NET Core 1.0 中获取 bin 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在 ASP.NET Core 中模拟 IFormFile 以进行单元/集成测试? 下一篇:在 ASP MVC 6 中将多个路由分配给同一控制器或操作

                相关文章

                <small id='gFQGc'></small><noframes id='gFQGc'>

                • <bdo id='gFQGc'></bdo><ul id='gFQGc'></ul>

                <i id='gFQGc'><tr id='gFQGc'><dt id='gFQGc'><q id='gFQGc'><span id='gFQGc'><b id='gFQGc'><form id='gFQGc'><ins id='gFQGc'></ins><ul id='gFQGc'></ul><sub id='gFQGc'></sub></form><legend id='gFQGc'></legend><bdo id='gFQGc'><pre id='gFQGc'><center id='gFQGc'></center></pre></bdo></b><th id='gFQGc'></th></span></q></dt></tr></i><div id='gFQGc'><tfoot id='gFQGc'></tfoot><dl id='gFQGc'><fieldset id='gFQGc'></fieldset></dl></div>

                  <legend id='gFQGc'><style id='gFQGc'><dir id='gFQGc'><q id='gFQGc'></q></dir></style></legend>
                1. <tfoot id='gFQGc'></tfoot>