使用 Azure OpenAI 和 AI 搜索与 Python SDK 进行 RAG 的最佳方法
我很难理解使用 Azure OpenAI、AI Search 作为源和 Python SDK 来实现 RAG 的每种方法的优缺点。两者都很好用,但选项 B...
Azure Pipelines 托管代理已更新,现在包含 .Net 5.x SDK/运行时以及较旧的 .Net Core
最近将我的应用程序升级到.NET 8.0。 Azure 管道中出现以下错误。 ##[错误]错误:进程“/opt/hostedtoolcache/dotnet/dotnet”失败,退出代码为 2 信息:Azure Pipelines h...
如何在 mac m1 中安装.net 5 sdk [已关闭]
无法在我的 mac m1 中安装 .net 5 sdk。我正在尝试编译一个 C# 项目及其要求 .net 5.0 sdk。 我尝试从官方网站下载它,但arm64不存在...
如何创建/连接到 Docker Azure 服务总线(使用 Python SDK)?
我正在使用适用于 Azure 服务总线的 Python 3.8 SDK(azure-servicebus v. 0.50.3)。 我使用以下代码向主题发送消息...... 服务 = ServiceBusService(service_namespace, ...
在 Firely .Net Sdk 中创建患者 FHIR API 负载时出错
我正在尝试使用以下 API Url 在 EPIC 沙盒中创建患者 https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/Patient 我正在使用 Firely .Net Sdk 进行 EPIC FHIR API 集成...
使用 Java SDK 查询 Kusto 时如何避免“PKIX 路径构建失败”错误?
我正在使用 Java SDK for Kusto(Azure 数据资源管理器)。 com.microsoft.azure.kusto kusto 数据 5.0.3 我是
使用 Azure Web App 部署任务时,您必须选择将在 Azure Web App 中使用的运行时堆栈。 我最近从 .NET 6 更新到 .NET 8,令我惊讶的是你可以随时随地设置 .NET 8...
AWS 中的积分部分是否有 API 支持? 我有兴趣通过促销代码以编程方式兑换积分。 我已经浏览了 .NET SDK 文档和开发人员指南...
dotnet 工具在 Linux 中无法工作。您必须安装或更新 .NET 才能运行此应用程序。应用程序
这是我在电脑上安装的.NET 的信息。 点网--信息 .NET SDK: 版本:8.0.100 提交:57efcf1350 工作负载版本:8.0.100-manifests.6c33ef20 运行时环境...
尝试使用 .NET 8 将端口 80 或 443 绑定到 Azure 容器实例中的 Kestrel 时,SocketException 权限被拒绝
将应用程序升级到 .NET 8 后,Linux Azure 容器实例 (ACI) 会出现此问题;完全相同的代码适用于 .NET 6(即,如果我只更改 .cs 中的 ...
如何在 Azure CognitiveServices SDK 中将 SpeechSynthesizer 对象的文本音量更改为语音音量,而不更改 c# 中的系统音量
我正在使用 C# 和文本转语音 Azure SDK。相对于其他声音来说,声音非常大,这是一个问题。除非我只能更改 TTS 音量,否则我无法使用此功能。我发现...
.NET Docker:当构建多目标依赖项需要更新版本的 SDK 时,我是否还应该更新运行时基础映像?
我有具有多目标的依赖项目: net8.0;net7.0;net6.0;net48 我的其他微服务是基于 .NET 7 构建的: 网络...
使用“azd up”部署.net Aspire应用程序时,是否可以同时部署相关的Azure资源(组件)?
使用 Azure 组件(例如服务总线)创建 .net Aspire 应用程序时,我必须先在 Azure 上创建资源,然后才能在本地运行该应用程序。 当我最终部署时...
我正在尝试为 Sentry .NET SDK 实现代码覆盖率。 由于这是一个开源存储库,我需要选择一个免费提供的代码覆盖工具,以便任何人都可以构建解决方案...
我有一个关于 C# 中的 DefaultAzureCredential() 的问题,它是一个 Azure 方法
我目前正在使用 .NET 6 开发 API 控制器。 Azure SQL 使用始终加密,但连接到 .NET 时发生错误。 当我纠正错误时,我问你一个问题...
在 .NET Core 3.1 中验证 Azure AD 生成的 JWT 签名和算法
我是 Azure AD 新手。我们正在使用 v1.0 令牌。我有一个 Azure JWT 令牌验证例程,主要基于 ValidateSignature 和 AzureTokenValidation 以下是我的 ClaimsTransformer: 公共任务...
使用 Azure SDK for Java 创建 KeyClient 时出现问题
我正在尝试在代码中创建一个 KeyClient 对象,以便我可以在 azure key Vault 中创建密钥。 但我的对象不断出现服务错误,直到现在我才解决它。 这是我的代码: @Overri...
如何在.NET SDK样式.csproj中设置BuildInParallel =“false”?
如何在我的.csproj中设置BuildInParallel =“false”? 在以下示例中,.csproj 有两个针对 net6.0 和 net8.0 的构建目标。默认情况下,它们在并行构建过程中运行...
如何设置 AZURE PHP SDK 到 SAS 连接字符串
我正在尝试从 Azur 服务总线中客户端的主题和订阅中获取消息。连接字符串如下所示: $连接字符串 = “端点=.servicebus。
如何使用 .NET 8 隔离工作模型对 Azure 函数进行 Docker 化以进行集成测试?
我有一个用 .NET 8 编写的 Azure 函数,它使用隔离的工作线程模型。 我想为此函数编写集成测试,因此想在内存中启动它。 我调查了
从Azure DevOps管道库变量到Aspire .NET容器的Envvar
有一个Azure Devops管道,该管道在库中设置了变量。每个环境都有一个库组,例如“开发”和“ UAT”。管道使用YAML创建AN ...
ASP.NET Core 8 Razor Pages 身份角色分配问题 UseSQLite
我的工作环境: macOS14 苹果硅 我的开发环境: 视觉工作室代码 DB浏览器(SQLite) .NET SDK 版本 8.0.401 ASP.NET Core 运行时版本 8.0.11 SQLite 版本 3.47 我正在工作...
您的应用程序已使用 Google Cloud SDK 中的最终用户凭据进行身份验证
我对与 .net 应用程序集成的对话流检测意图功能有疑问。 gcloud、GOOGLE_APPLICATION_CREDENTIALS、gcloud auth activate-service-account 并设置项目属性已启用...
API 在构建 OData EdmModel 时挂起,但仅在部署到 Azure 时
我有一个 ASP.NET Web API,其中 OData 在 .NET 4.6.1 和 Azure 应用服务中运行。在启动过程中,它为几个非常简单的实体构建并注册 OData EdmModel。当我...
使用 Github Actions 恢复 Azure DevOps 中托管的私有 Nuget 包失败
我有一个 .NET 项目,它使用托管在 Azure DevOps 中的私有 Nuget 包。我有一个 Github Actions 工作流程,它使用个人访问令牌注册私人提要,并恢复
Azure Function App 无法启动 Docker 容器,原因是“Azure.RequestFailedException:指定的资源名称包含无效字符。”
我们有一个从 Docker 映像部署的 Azure Function 应用程序。 该函数正在运行 .NET 8.0,FUNCTIONS_EXTENSION_VERSION = ~4 且 FUNCTIONS_WORKER_RUNTIME = dotnet-isolated。 该应用程序包含...
Azure IoT 设备配置服务 – 设备注册 C# SDK – “找不到 CA 证书”
参考链接中的示例 - X509 注册组指南使用证书链 我正在尝试创建一个安静的服务(.net7 web api),它执行以下三件事: 上传根证书...
无法在 Azure DevOps 中使用 Visual Studio 17.8.3 包发布 .Net Maui Asp.Net 7 或 8 iOS 应用程序
我的应用程序过去使用 Azure DevOps 发布得很好,当时它是一个面向 iOS 16.1 且支持 15.4 框架的 ASP.net 7 应用程序。我使用的是 Visual Studio Enterprise 2022 17.5.3 包。 我...
我在.net 7.0中使用N层架构创建了一个项目。我的项目中还有API层和UI层。我想对我的项目进行 docker 化
`也就是说,在一个N层架构的有API层和UI层的项目中,dockerfile文件应该是什么样的? 来自 mcr.microsoft.com/dotnet/sdk:7.0 作为构建 工作目录/应用程序 复制./
为什么我无法使用 use:action Svelte 添加/删除主体类
我有这个功能 const bodyClass = (节点) => { if (open && !node.classList.contains("is-search-show")) { node.classList.add("is-search-show&quo...
如何在基于 Windows 的容器内测试应用服务上的安全标头?
我已经在我的网络应用程序上设置了 HSTS。它是一个带有 .net 后端的 Angular 应用程序,托管在 Windows 容器中的 Azure 应用服务上。我对 Startup.cs 进行了更改: services.AddHsts(选项=&...
具有四个虚拟应用程序的 Azure Web App 无法启动一个 ASP.NET Core 6 Web API
我们有一个应用程序服务,托管四个虚拟应用程序:一个 Vue 应用程序(静态)、一个 Angular 应用程序(静态)和两个用 .NET 编写的 API: 四个虚拟应用程序 这四个人并肩成功...
我想更改 osclass 上的 url 并将 , 替换为 - 现在网址就像:127.0.0.1/en/search/region,9354963/category,books-magazines 我想将网址转换为 127.0.0.1/en/search/region-93...
我在我的博客中使用简单的搜索: 后rb has_rich_text :内容 def self.search(搜索) where('标题ILIKE?或内容ILIKE ?', "%#{search}%", "%#{search}%") 结尾 post_controller.r...
<ImplicitUsings>.NET8项目中,有漏洞吗?
使用MS提供的升级助手,我正在尝试将我的项目从.NET 6升级到8。 我注意到它被插入到我的项目文件的顶部:enabled 使用 MS 提供的升级助手,我正在尝试将我的项目从 .NET 6 升级到 8。 我注意到它被插入到我的项目文件的顶部:<ImplicitUsings>enabled</ImplicitUsings> 我的问题是:<ImplicitUsings>是否为我的项目提供任何可能的攻击媒介?我有一种感觉,图书馆可以通过这种方式被劫持。 有人有消息吗? 谢谢! 您的项目没有风险。它只是清理文件顶部的 using 声明。它不会添加任何对您的项目的引用。 它只是应用项目 SDK 指定的全局使用。 它一点也不脆弱。
在 .NET 6 中使用 xsltc.exe 生成的程序集(XSLT 样式表)
我有一个 XSLT 样式表“Stylesheet.xsl”,我已使用 xsltc.exe 将其编译为“Stylesheet.dll” 该 DLL 包含在我的 .NET 6 中(net6.0 我有一个 XSLT 样式表“Stylesheet.xsl”,我已使用 xsltc.exe 将其编译为“Stylesheet.dll” 该 DLL 包含在我的 .NET 6 (<TargetFramework>net6.0</TargetFramework>) 项目中,用法如下: var xslCompiledTransform = new XslCompiledTransform(); xslCompiledTransform.Load(typeof(Stylesheet)); // ↑ System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. xslCompiledTransform.Transform(@"..\..\..\input.xml", @"..\..\..\output.xml"); Load方法抛出FileNotFoundException,并显示消息“无法加载文件或程序集‘System.Data.SqlXml,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089’。系统找不到指定的文件。 ” 关于 xsltc.exe 的文档说明了以下内容: 脚本块仅在 .NET Framework 中受支持。 .NET Core 或 .NET 5 或更高版本不支持它们。 这严重暗示使用 xsltc.exe 编译的样式表应该在 .NET Core 或 .NET 5 或更高版本上工作(当不使用脚本块时),但在我的测试中却不起作用。 有谁知道为什么使用 xsltc.exe 编译的样式表不适用于 .NET 6 以及如何解决此问题? 更多详情 我在下面添加了有关我尝试过的更多详细信息。 请注意,我使用的样式表Stylesheet.xsl非常基本,没有使用特殊功能:<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="/"> <output> <xsl:for-each select="input/book"> <booktitle> <xsl:value-of select="@title" /> </booktitle> </xsl:for-each> </output> </xsl:template> </xsl:stylesheet> 生成DLL的命令: "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\xsltc.exe" Stylesheet.xsl 在 SDK 样式的 .csproj 文件中引用 DLL: <ItemGroup> <Reference Include="Stylesheet"> <HintPath>.\Stylesheet.dll</HintPath> </Reference> </ItemGroup> input.xml:<input> <book title="First Title" /> <book title="Second Title" /> </input> output.xml 使用未编译的样式表执行转换时:<output> <booktitle>First Title</booktitle> <booktitle>Second Title</booktitle> </output> 我已经研究并发现其他人也有同样的问题,但还没有找到解决方案或解释为什么 Microsoft 文档隐式声明它应该可以工作,而在我的测试中却不起作用。 https://github.com/dotnet/runtime/issues/68129 在.NET Core 2.2中使用xsltc.exe生成的程序集? XslCompiledTransform.Load(type):无法加载文件或程序集“System.Data.SqlXml” System.IO.FileNotFoundException的堆栈跟踪: at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags) at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags) at System.Reflection.RuntimeMethodInfo.CreateDelegate(Type delegateType) at System.Xml.Xsl.XslCompiledTransform.Load(MethodInfo executeMethod, Byte[] queryData, Type[] earlyBoundTypes) at System.Xml.Xsl.XslCompiledTransform.Load(Type compiledStylesheet) at TestXslDotnet6.Program.Main(String[] args) in C:\Users\UserNameRedacted\Path\To\Repo\TestXslDotnet6\TestXslDotnet6\Program.cs:line 10 根据 GitHub 问题 .NET 6 不支持 XslCompiledTransform.Load(type(myXsltCompiled_dll)) 中的信息,看起来好像不支持,也不会支持。 2022年4月18日的评论说: 程序集 System.Data.SqlXml 包含命名空间 System.Xml.Xsl.Runtime,该命名空间在 .NET Core 中不存在。 根据移植指南,msxsl:script 在 .NET Core 上不可用。 .NET Framework 特定教程预计不起作用。 第二个人评论: 看起来 System.Data.SqlXml 是 SQLXML 的一部分,属于 据我所知,SQL Server org 不支持 .NET Core。 第三个人回复: 目前没有关于 SQLXML 和对 .NET 5+ 支持的计划, 我们还没有听到很多这方面的请求。我会 建议在此处开放用户声音以获得一些吸引力并 关于该主题的共识:https://aka.ms/sqlfeedback 所以,这就是您的答案:“msxsl:script 在 .NET Core 上不可用。.NET Framework 特定教程预计不起作用。”原因是非 .NET 组织必须使其成为可能,但没有计划这样做。他们没有意识到需求。 而且,他们承认该文档具有误导性。似乎在 2022 年 5 月对文档进行了更改,并创建了拉取请求:请注意,XSLT 脚本块仅限 .NET Framework。 我认识到这并没有为您提供解决方案或前进的道路,这令人失望。但这就是您问题的答案:.NET 6.0 根本不支持以这种方式进行转换。 虽然距离这个问题大约有两年了,但我还是想分享一下我为自己的目的所做的解决方法,因为我没有找到任何其他解决方案,可以帮助在基于 .NET Core 的转换中使用编译的 xslt dll。 因此,如果您想将 XslCompiledTransform 类与通过 xlstc.exe 生成的 dll 类型一起使用,请按照以下步骤操作: 生成dll类 xsltc.exe /class:Transform /out:Your.Assembly.dll 将 dll 反汇编为 ILL 代码 ildasm Your.Assembly.dll /out=Your.Assembly.ill 将 Your.Assembly.ill 中所有出现的 [System.Data.SqlXml] 替换为 [System.Private.Xml] 将你的IL编译回dll ilasm Your.Assembly.ill /dll 现在您可以将 Your.Assembly.dll 引用添加到您的 .NET Core 项目
<= x<= pi, 0<=y, z<=2pi. I have written a matlab code to global search the maximum point, with step length 0.01. I also restored the function ...
错误:您不拥有此网站,Google Search Console API
我不断收到错误:“错误:您不拥有此网站,或者检查的 URL 不属于此属性。”当尝试使用 Google Search Console API 检查网址时,尽管我是
ASP.NET MVC 项目模板在移动设备上无法调整为 100%
我不明白为什么 Web .Net MVC 项目上的默认模板没有在移动设备中调整为 100% 宽度。 我在视图上使用数据表: @模型IEnumerable 我不明白为什么 Web .Net MVC 项目上的默认模板没有在移动设备中调整为 100% 宽度。 我在视图上使用数据表: @model IEnumerable<iziConference.Models.EventAttendee> <h2>Participantes.</h2> <br /> <button><a style="text-decoration: none" href='@Url.Action("Create", new { eventId = ViewBag.EventId })'>Criar Participante</a></button> <button id="at-btn-refresh"> Actualizar</button> <input id="eventId" type="hidden" value="@ViewBag.EventId"> <table id="at-attendees-list" cellpadding="10" border="1" class="row-border stripe"> <thead> <tr> <th>ID</th> <th>Tipo</th> <th>Nome</th> <th>Email</th> <th>Estado </th> </tr> </thead> <tbody> @foreach (var item in Model) { <tr id="[email protected]_Id"> <td style="padding: 5px"> @Html.DisplayFor(modelItem => item.Attendee.Id) </td> <td> @Html.DisplayFor(modelItem => item.AttendeeType) </td> <td> @Html.DisplayFor(modelItem => item.Attendee.Name) </td> <td> @Html.DisplayFor(modelItem => item.Attendee.Email) </td> <td> @if (item.IsActive) { <button id="[email protected]_Id" class="at-btn-active-state active" data-attendee-id="@item.Attendee_Id" data-attendee-name="@item.Attendee.Name" data-active-new-state="false" data-show-confirmation-alert="true">Desactivar</button> } else { <button id="[email protected]_Id" class="at-btn-active-state inactive" data-attendee-id="@item.Attendee_Id" data-attendee-name="@item.Attendee.Name" data-active-new-state="true" data-show-confirmation-alert="true">Activar</button> } </td> </tr> } </tbody> </table> 由脚本加载: var _atteendeesList = "at-attendees-list"; $("#" + _atteendeesList).DataTable({ "paging": false, "info": false, "language": { "search": "Pesquisar:", "info": "Participantes inscritos: _PAGES_" } }); 使用默认的_Layout.cshtml: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>izigo Conference - Gestor de Conteúdos</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <header> <div class="content-wrapper"> <section id="login"> @Html.Partial(MVC.Account.Views._LoginPartial) </section> <div style="padding: 10px;"> @if (Request.IsAuthenticated) { <nav> <ul id="menu"> <li>@Html.ActionLink("Home", MVC.Home.Index())</li> <li>@Html.ActionLink("Participantes", MVC.Attendee.Index())</li> <li>@Html.ActionLink("Check-in", MVC.Checkin.Index())</li> </ul> </nav> } </div> </div> </header> <div id="body"> @RenderSection("featured", required: false) <section class="content-wrapper main-content clear-fix"> @RenderBody() </section> </div> <footer style="padding-left: 25px;"> <div class="content-wrapper"> <div class="float-left"> <p>© @DateTime.Now.Year - <a href="https://www.izigo.pt/conference" target="_blank">izigo Conference</a> - <i>Powered by</i><a href="https://www.izigo.pt" target="_blank">izigo.pt</a></p> </div> </div> </footer> @Scripts.Render("~/bundles/jquery", "~/bundles/iziconference") @RenderSection("scripts", required: false) </body> </html> 研究了 dataTables 库的选项后,我找到了一个创建响应式解决方案的选项: 我已经包含了响应表结构和columnDefs的选项,以选择哪些选项在移动设备中保持可见: $("#" + _atteendeesList).DataTable({ "responsive": true, "columnDefs": [ { responsivePriority: 1, targets: 0 }, { responsivePriority: 2, targets: -1 } ], "paging": false, "info": false, "language": { "search": "Pesquisar:", "info": "Participantes inscritos: _PAGES_" } }); 我还必须在捆绑包中包含数据表扩展的 js 和 css 响应式库(可在此处下载:https://datatables.net/download/): bundles.Add(new ScriptBundle("~/bundles/iziconference").Include( "~/Content/Scripts/datatables.min.js", "~/Content/Scripts/dataTables.responsive.min.js")); // add-on bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/Styles/datatables.min.css", "~/Content/Styles/responsive.dataTables.min.css"));
修复 Flutter GitHub 项目导入错误:Dart SDK 版本和空安全兼容性
从github导入flutter中的任何项目时,它显示“sdk:'> = 2.7.0的下限<3.0.0'" must be 2.12.0' or higher to enable null safety. The current Dart SDK (3.2.3)...
注意:meta 通过 flutter SDK 中的integration_test 固定到版本 1.10.0。 有关详细信息,请参阅 https://dart.dev/go/sdk-version-pinning。 因为 sdk 中的每个版本的integration_test都依赖于...
AWS JS SDK S3 HeadObject 命令抛出错误“检查您是否已显式安装“@aws-sdk/signature-v4-crt”包”
我正在通过CDK部署lambda函数。该函数使用适用于 Nodejs 的 aws-sdk 将 HeadObject 请求发送到多区域接入点 (MRAP)。 当我发送这个 HeadObject 请求时,sdk
BadRequestKeyError:400 错误请求:浏览器(或代理)发送了该服务器无法理解的请求。关键错误:“搜索”标题
App.html 标题 应用程序.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <form action="." method="post"> Search: <input type="text" name="search"> <input type="submit" value="Show"> </form> </body> </html> main.py from flask import Flask, render_template, request app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/CmpPr') def cmpP(): return render_template('CmpPr.html') @app.route('/CmpSpes') def cmpS(): return render_template('CmpSpes.html') @app.route('/App', methods=['POST', 'GET']) def App(): search = request.form['search'] return render_template('output.html', n=search) @app.route('/Gro') def Gro(): return render_template('Gro.html') if __name__ == '__main__': app.run(debug=True) 我创建了多个 html 页面 我想打印消息,从 TextBox 请求(上面的代码)并打印到另一个 html 页面 我尝试使用 request.form.get('search') 但它返回 null 如果我使用 request.form.get('search', FALSE 或 TRUE) 它会返回 FALSE 或 TRUE 我还使用了 if else 循环来指定 GET 和 POST 方法,但仍然显示相同的错误 任何人都可以帮我解决这个问题吗 谢谢你 首先,您的表单操作应该指向处理表单数据的视图(即/App): <form action="/App" method="post"> 其次,您应该只在请求方法为POST时获取表单数据,因为您已经在模板中设置了method="post"。另外,当请求方法为 GET 时,您需要渲染包含表单的 App.html: @app.route('/App', methods=['POST', 'GET']) def App(): if request.method == 'POST': # get form data when method is POST search = request.form['search'] return render_template('output.html', n=search) return render_template('App.html') # when the method is GET, it will render App.html 附注您收到的错误已清楚地解释为表单数据中没有名为 search 的键。 你可以试试这个,对我有用 @app.route('/predict_home_price', methods=['POST']) def predict_home_price(): try: data = request.get_json() # Expecting JSON data # Check if required data is provided if not data: return jsonify({'error': 'No JSON data received'}), 400
调用 OpenAI 完成端点时如何从 AI-Search 文档获取正确的上下文
我找到了有关使用 AI-Search 和 OpenAI 与自己的数据聊天的文档。 它适用于我的数据,但是除了内容和分数之外我没有得到任何其他上下文: {&
棱镜:ViewModelLocator.AutowireViewModel 不适用于内容视图
我正在将使用 Prism 的 Xamarin.Forms 应用程序迁移到 .NET Maui。该应用程序有一个 TabbedPage 导航。此迁移有效。 但是 ContentPages 包含几个 ContentView,如下所示: 我正在将使用 Prism 的 Xamarin.Forms 应用程序迁移到 .NET Maui。该应用程序有一个 TabbedPage 导航。此迁移有效。 但是 ContentPages 包含几个 ContentView,如下所示: <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:MauiDemo.Views" x:Class="MauiDemo.Views.HomePage" Title="HomePage"> <VerticalStackLayout> <views:FirstContentView HeightRequest="200"/> <views:SecondContentView HeightRequest="200"/> </VerticalStackLayout> </ContentPage> 在 Xamarin 中,我能够将 prism:ViewModelLocator.Autowire="true" 属性添加到 contentview 中,并且 prism 找到了关联的视图模型。在 .NET maui 中,prism:ViewModelLocator.AutowireViewModel="Automatic" 属性没有任何作用。 例如,ContentView 的名称是 “FirstContentView”。关联的viewModel的名称是“FirstContentViewViewModel” 根据https://prismlibrary.com/docs/maui/migration.html中的描述,它应该可以工作,但事实并非如此。 配置这样的自动接线有什么技巧吗? 我使用 prism 存储库的当前克隆 https://github.com/PrismLibrary/Prism 以及带有最新 MAUI 组件的当前 .NET8 SDK 我使用区域而不是通过自动装配。具有不同 ContentView 的页面应该如下所示 <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:MauiDemo.Views" xmlns:prism="http://prismlibrary.com" x:Class="MauiDemo.Views.HomePage" Title="HomePage"> <VerticalStackLayout> <ContentView prism:RegionManager.RegionName="FirstContent"/> <ContentView prism:RegionManager.RegionName="SecondContent"/> </VerticalStackLayout> </ContentPage> 所需的视图及其视图模型应在 MauiProgram 中注册为 RegisterForRegionNavigation container.RegisterForRegionNavigation<FirstContentView, FirstContentViewViewModel>(); container.RegisterForRegionNavigation<SecondContentView, SecondContentViewModel>(); .UsePrism(prism => { prism.RegisterTypes(container => { container.RegisterForNavigation<MainPage,MainPageViewModel>(); container.RegisterForNavigation<HomePage>(); container.RegisterForRegionNavigation<FirstContentView, FirstContentViewViewModel>(); container.RegisterForRegionNavigation<SecondContentView, SecondContentViewModel>(); }) .CreateWindow(navigationService => navigationService.CreateBuilder() .AddSegment<MainPage>() .NavigateAsync(HandleNavigationError)); }) 包含多个ContentView的页面的ViewModel应该为所需的ContentView调用RegionManager.RequestNavigate方法。 public class HomePageViewModel : ViewModelBase, IInitialize { private readonly IRegionManager _regionManager; public HomePageViewModel(IRegionManager regionManager) { _regionManager = regionManager; } public void Initialize(INavigationParameters parameters) { _regionManager.RequestNavigate("FirstContent", nameof(FirstContentView)); _regionManager.RequestNavigate("SecondContent", nameof(SecondContentView)); } } 仅此而已。它的工作原理如https://xamgirl.com/prism-regions-in-xamarin-forms/所述
Control Maps Net Maui (net 8.0) for Windows
我正在使用 net 8.0,我想使用 Maui.Controls.Map。 MauiProgram.cs 中的代码是: 公共静态 MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuild...
我在 Flutter SEO 上真的很挣扎。 根据这篇文章,Flutter 中的 SEO 不好 https://docs.flutter.dev/platform-integration/web/faq#search-engine-optimization-seo 我在想如果
使用 jquery javascript 搜索 jstree 节点
我正在使用 jstree 插件来构建我的树。我的网页中有一个搜索框,我需要用户能够在其中搜索 jstree 节点。 我正在使用 jstree 插件来构建我的树。我的网页中有一个搜索框,我需要用户能够在其中搜索 jstree 节点。 <fieldset id="search"> <input type="text" name="search_field" id="search_field" value="" /> <button id="search_tree">Search</button> </fieldset> 单击搜索时,jstree 节点应展开,如果找到,节点应突出显示。如果未找到,则应向用户显示错误,如“未找到”。我的代码用于展开下面的所有节点。有没有简单的方法来搜索jstree中的所有节点? <script type="text/javascript"> $(document).ready(function(){ $("#search_tree").click(function () { var value=document.getElementById("search_field").value; $("#tree").jstree("search",value); }); $("#tree").jstree({ "xml_data" : { "ajax" : { "url" : "jstree.xml" }, "xsl" : "nest" }, "themes" : { "theme" : "classic", "dots" : true, "icons" : true }, "search" : { "case_insensitive" : true, "ajax" : { "url" : "jstree.xml" } }, "plugins" : ["themes", "xml_data", "ui","types", "search"] }); }); </script> 我收到此错误: Instances[...] 为 null 或不是对象。这是一个 jstree 错误。有什么想法吗? 我已将这段代码添加到我的函数中: "search" : { "case_insensitive" : true, "ajax" : { "url" : "jstree.xml" } }, "plugins" : ["themes", "xml_data", "ui","types", "search"] 和 创建了此功能并与我的单击按钮相关联: function myFunction() { $(document).ready(function(){ var value=document.getElementById("search_field").value; $("#search_tree").click(function () { $("#tree").jstree("search",value) }); }); } 2023年,API逐年变化。使用版本v3.3.x, 这是我的工作代码: 创建jstree实例,配置如下: 当您搜索关键字时,请使用: