- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个简单的 .NET Web 应用程序,当我在本地机器上运行它时它运行良好。但是,当我尝试将应用程序发布到本地文件夹时,我看到了“索引超出数组范围”的错误消息。恐怕这个错误非常模糊,我无法弄清楚问题是什么。
我正在 Visual Studio 社区 2019 上创建这个项目。
有人可以帮我弄清楚问题是什么:)
最佳答案
我不知道这个问题或解决方案,但这是我使用的解决方法。
本质上,您需要手动创建发布文件夹和文件配置文件。
我为 .NET Core 3.1 Blazor 项目做了这个
第 1 步 - 在您的项目中,转到 Properties 文件夹,您可以在其中找到 launchSettings.json
第 2 步 - 在里面,创建一个文件夹并将其命名为“PublishProfiles”
第 3 步 - 在 PublishProfiles 文件夹内,创建一个文件并将其命名为“FolderProfile.pubxml”
第 4 步 - 在此文件中,粘贴此代码并将位置路径添加到您要发布的文件夹中:
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>True</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>Your location path where you want to publish your application</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>netcoreapp3.1</TargetFramework>
<ProjectGuid>08d93ba4-c83c-47e9-a83e-73f12d97626a</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
第 5 步 - 创建另一个文件并将其命名为“FolderProfile.pubxml.user”并将此代码粘贴到其中。再次插入所需文件夹的路径:
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PublishTargetUrl>Your location path where you want to publish your application</_PublishTargetUrl>
<History>True|2021-07-02T16:47:41.7255934Z;True|2021-07-02T12:44:24.1064885-04:00;True|2021-05-21T09:22:02.2383330-04:00;True|2021-05-20T17:42:40.0758569-04:00;True|2021-05-20T09:45:45.4390896-04:00;True|2021-05-20T09:02:32.8340404-04:00;</History>
</PropertyGroup>
</Project>
第 6 步 - 之后,您应该能够在 Visual Studio 中右键单击您的项目,单击选项发布...,带有发布按钮的屏幕应该可见。
关于c# - 发布 .NET Web 应用程序时出现 "Index was outside the bounds of the array"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63182078/
在许多在线资源中,可以找到“内存”、“带宽”、“延迟”绑定(bind)内核的不同用法。在我看来,作者有时会使用他们自己对这些术语的定义,我认为这对某人做出明确区分非常有益。 据我了解:带宽绑定(bin
FIFO、LIFO 和LC Branch and Bound 有什么区别? 最佳答案 Branch & Bound 通过使用估计边界来限制可能解决方案的数量来发现完整搜索空间内的分支。不同的类型(FI
我有一个网页,其中有一些 Kendo 控件(例如下拉菜单和按钮)可以正常工作,但是添加Grid 会导致问题。 @(Html.Kendo().Grid(Model).Name("grid").Colu
术语“CPU 限制”和“I/O 限制”是什么意思? 最佳答案 这非常直观: 如果 CPU 更快,程序就会运行得更快,即程序的大部分时间只是使用 CPU(进行计算),则该程序是 CPU 密集型。 计算
我在以下代码段中遇到问题并发出警告,希望您能帮助我: fprintf (fp, "%dd%d+%d ", pMobIndex->mana[DICE_NUMBER], DICE_NUMBER 在我
swift 2 let gap = CGFloat(randomInRange(StackGapMinWidth...maxGap)) Missing argument label 'range:'
swift 2 let gap = CGFloat(randomInRange(StackGapMinWidth...maxGap)) Missing argument label 'range:'
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关闭 6 年前。 这个问题是由于打字错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在
我想在gcc8.2下启用数组边界检查,这样可以帮助在编译期间检查数组下标是否越界,它可能会给出如下警告:数组下标高于数组边界 [-Warray-bounds] 我使用 coliru 做了一个演示: #
我只是想知道在 Apple API 中的什么地方定义了变量“bounds.minX”、“bounds.maxX”?我查看了“UIView”和“CGRect”文档,但似乎找不到它? 最佳答案 它包含在"
我想覆盖整个屏幕。我想将其框架设置为覆盖整个屏幕。浏览堆栈溢出时,我发现了这两种不同的设置 View 框架以覆盖屏幕的方法: [UIScreen mainScreen].bounds [UIApplc
在协程中执行 IO 绑定(bind)函数(例如,从后端请求数据)给了我一个优势,即在请求结果可用之前暂停它的执行,对吗?但是,受 CPU 限制的函数(例如,解析一个巨大的文本文件)不会“等待”任何东西
public class ChampionsLeague> extends League{ ... 如何创建此类的实例? ChampionsLeague league = new ChampionsL
我遇到了以下问题: 我有这些类和接口(interface)定义 public abstract class ViewModelRefreshPostListFragment> extends
我注意到在使用 (Swift 4.0) 的 IOS X 代码中,我至少可以通过以下两种方式请求 View 的高度 V: V.bounds.size.height 和... V.bounds.heigh
swift 中 bounds.size.width 和 bounds.width 有什么区别?他们会返回同样的东西吗?谢谢! 最佳答案 bounds 是 UIView 的 CGRect 结构属性,其中
在我看来不可能包含 Integer.MAX_VALUE和Long.MAX_VALUE创建 IntStream 时尽可能使用随机值或LongStream使用 java.util.Random 的边界类。
我有二叉树类: public class BinaryTree> extends AbstractTree { protected TreeNode root;
我最近做了并更新了我的 Xamarin iOS 项目,我曾经能够调用以下代码来检索屏幕宽度和高度: if (orientation == UIInterfaceOrientation.Landscap
我仍然不明白为什么我收到这个警告 array subscript is above array bounds [-Warray-bounds] 对于一个小的 C 代码如下: #include #in
我是一名优秀的程序员,十分优秀!