runtime-identifier 相关问题


使用 Nodejs18 运行时将 `@aws-sdk/client-bedrock-runtime` 导入 AWS Lambda 函数

我正在尝试使用 NodeJs18 运行时将 @aws-sdk/client-bedrock-runtime 导入到 AWS Lambda 函数中。 该软件包应该可用,因为根据 AWS 文档,“对于 Node.js 版本......


为什么 futures::executor::block_on 挂在诗歌处理程序中

使用 tokio::runtime::Handle; // 1.0.2 使用诗::{ 获取、处理程序、侦听器::TcpListener、中间件::跟踪、web::Path、EndpointExt、路由、服务器、 }; fn inside_example(handle: Handle) -> 字符串...


在NAS Synology中发布Net Core Web API,Web根路径问题

我正在尝试使用 hgy59 的 Synology 套件“.NET 6.0 Runtime”来创建一个小型网站。我正在使用这篇文章的示例: 在 NAS 中发布 Net Core Web API Synology 我找不到...


下面的Browser Engine图和JS Runtime图之间的桥梁是什么?

我一直在阅读有关浏览器如何工作以及浏览器的组件是什么的内容。我看到了各种关于浏览器如何解析 JS 和渲染过程等的文章,但我不是


程序集绑定重定向到较低版本

我正在尝试降级 NServiceBus 依赖项,因此不要使用 4.0.0.0 而是使用 2.5.0.0 我正在尝试以下方法,但似乎都不起作用。 我正在尝试降级 NServiceBus 依赖项,因此不要使用 4.0.0.0 而是使用 2.5.0.0 我正在尝试以下方法,但似乎都不起作用。 <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="NServiceBus" publicKeyToken="9fc386479f8a226c" culture="neutral"/> <bindingRedirect oldVersion="4.0.0.0" newVersion="2.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> 我也尝试过使用代码库: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="NServiceBus" publicKeyToken="9fc386479f8a226c" culture="neutral"/> <codeBase version="2.5.0.0" href="NServiceBus.dll"/> </dependentAssembly> </assemblyBinding> </runtime> 不过,没什么。我浏览了 msdn 文档,没有提到以“向后”的方式使用此功能。这可能吗? 实际上,我正在将您的第一个语句用于某些互操作 DLL,因为我们公司的客户在 Office 更新方面有不同的状态。这是我使用的代码: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="office" publicKeyToken="71E9BCE111E9429C" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="11.0.0.0"/> </dependentAssembly> </assemblyBinding> 这提供了从 DLL 版本 14 到版本 11 的向后兼容性。您能提供您正在使用的 DLL 的链接吗? 我已经下载了 NServiceBus 框架(版本 3.3.8)并使用 ILSpy 检查了 DLL。我建议你对你的 DLL 做同样的事情。对于我的 DLL,它显示了与您相同的公钥令牌。您确定使用版本 4.0.0.0 而不是版本 3.3.0.0。或者您可能与公钥令牌不匹配。 根据 MSDN:https://msdn.microsoft.com/en-us/library/eftw1fys(v=vs.110).aspx 该值可以指定比oldVersion更早的版本。 指的是newVersion的bindingRedirect属性。同样在“备注”部分: 您还可以从程序集的较新版本重定向到旧版本。 他们的例子是: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="myAssembly" publicKeyToken="32ab4ba45e0a69a1" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 我确实注意到它还提到了一些有关应用程序配置文件中的显式程序集绑定重定向需要安全权限,也许这也会影响您? 上面的答案是很好的答案,但缺少重要的部分。如果你阅读评论,一些开发人员不再相信这是有效的。事实上,这是双向的,向上版本或向下版本 重要:文化 在我的实验中,只有当我将文化设置为中性时它才开始起作用。 (上面的例子有“en-us”) <assemblyIdentity name="..... culture="neutral"/> 在我的设置中,我有 WinApp 引用了 Lib1 和 Lib3。 Lib1参考Lib2和Lib3。 Lib2参考文献Lib3。当我按下按钮时,一个调用从 WinApp 一路传播到 Lib3(直接传播和通过库链传播),并且文本返回显示在屏幕上。 Lib3的名字很强大。 运行 1 - 未设置区域性 [assembly: AssemblyCulture("")],未设置绑定重定向 - 有效! 运行 2 - Lib3 中的较低版本,将绑定重定向设置为“en-us” - 失败! 运行 3 - Lib3 中的较低版本,将绑定重定向设置为“中性” - 有效!适用于向上版本和向下版本。 在其他运行中 - 使用设置 [assembly: AssemblyCulture("en-us")] - 当 AssemblyCulture 不为空时,所有尝试都会失败。事实上,当在WinApp中设置这个属性时,它甚至无法编译 错误CS7059:可执行文件不能是附属程序集;文化应该永远是空的 所以,我们开始吧。由于我不明白 AssemblyCulture 的所有复杂作用,我只声称我的实验仅证明在特定条件下版本重定向工作正常。 如果我没有理解错的话,我对 stimulsoft 报告 DDL 做了同样的事情,我安装了最新版本,但我想在我的应用程序中使用 2010.3。但不是通过配置文件和重定向: 我只是从解决方案资源管理器中删除了引用并添加了旧的 DLL 引用,然后设置了副本 Local 属性并重新编译,以便 DLL 与应用程序一起位于同一目录中,一切正常。也用其他一些 dll 完成了它。


标识符“ChatFeed”已被声明

从 'react-chat-engine' 导入 { ChatEngine, ChatFeed }; 从 './components/chatFeed' 导入 ChatFeed; 导入'./App.css'; 常量应用程序 = () => { 返回( import { ChatEngine, ChatFeed } from 'react-chat-engine'; import ChatFeed from './components/chatFeed'; import './App.css'; const App = () => { return( <ChatEngine height="100vh" projectID="" userName="" userSecret="" renderChatFeed={(chatAppProps) => <ChatFeed {...chatAppProps} />} /> ); } export default App; 服务器运行时显示错误 SyntaxError: D:\PROJECTS\APPLICATION\chat_app\src\App.js: Identifier 'ChatFeed' has already been declared. (3:7) 1 | import { ChatEngine, ChatFeed } from 'react-chat-engine'; 2 | > 3 | import ChatFeed from './components/chatFeed'; | ^ 好吧,错误消息说明了一切,您声明了 ChatFeed 两次。 您可以通过以下方式修复它: 重命名您的组件,例如 import ChatFeedComponent from './components/chatFeed'; 将命名导入从 react-chat-engine 重命名为 import { ChatEngine, ChatFeed as ChatFeedComp } from 'react-chat-engine'; 当然,随意使用你喜欢的任何名称 错误消息显示您导入 ChatFeed 两次。 您可以修复它,从第一行删除 chatFeed 用这个 从“react-chat-engine”导入{ChatEngine}; 从 './components/ChatFeed' 导入 ChatFeed;


如何以 Svelte 方式设置导出和开槽零件的样式?

Svelte slot 的功能是否像 vanilla-js/dom 一样(我似乎无法让它工作)。 在 html/js 中我可以这样做: 身体{颜色:红色;} /* 从外部设置暴露部分的样式 */ ...</desc> <question vote="0"> <p>Svelte <pre><code>slot</code></pre>的功能是否像 vanilla-js/dom 一样(我似乎无法让它工作)。</p> <p>在 html/js 中我可以做:</p> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code>&lt;style&gt; body {color: red;} /* style exposed part from outside */ my-element::part(header) {color: green;} &lt;/style&gt; &lt;h1&gt;Hello World&lt;/h1&gt; &lt;my-element&gt; &lt;div slot=&#34;header&#34;&gt;&lt;strong&gt;Header&lt;/strong&gt;&lt;/div&gt; &lt;div slot=&#34;body&#34;&gt;Body&lt;/div&gt; &lt;/my-element&gt; &lt;script&gt; customElements.define(&#39;my-element&#39;, class extends HTMLElement { constructor() { super(); const shadowRoot = this.attachShadow({mode: &#39;open&#39;}); shadowRoot.innerHTML = ` &lt;style&gt; .container { border: solid 1px blue; padding: 5px; position: relative; &amp;:after { content: &#34;my-element&#34;; display: block; position: absolute; bottom: -.5em; right: 5px; border: inherit; background-color: white; padding: inherit; } } /* style inserted/slotted part from inside */ [part=&#34;body&#34;] ::slotted(div) { background-color: lightyellow; } &lt;/style&gt; &lt;div class=&#34;container&#34;&gt; &lt;header part=&#34;header&#34;&gt;&lt;slot name=&#34;header&#34;&gt;&lt;/slot&gt;&lt;/header&gt; &lt;hr&gt; &lt;div part=&#34;body&#34;&gt;&lt;slot name=&#34;body&#34;&gt;&lt;/slot&gt;&lt;/div&gt; &lt;/div&gt; `; } }); &lt;/script&gt;</code></pre> </div> </div> <p></p> <p>其中 <pre><code>h1</code></pre> 的全局样式为红色,标有 <pre><code>part=&#34;header&#34;</code></pre> 的元素从外部设置为绿色,插入 <pre><code>slot=&#34;body&#34;</code></pre> 的内容从内部(shadow dom)设置为绿色有浅黄色背景。</p> <p>我不知道如何在 svelte 中执行任何这种(受控)跨界样式? (例如,当使用 <pre><code>AppShell::part(content)</code></pre> 时,我收到错误:</p> <pre><code>[plugin:vite-plugin-svelte] C:/srv/svelte/yoda5/src/routes/+layout.svelte:23:18 Expected a valid CSS identifier C:/srv/svelte/yoda5/src/routes/+layout.svelte:23:18 21 | 22 | &lt;style&gt; 23 | AppShell::part(content) { | ^ </code></pre> </question> <answer tick="false" vote="0"> <p>这里有关于<a href="https://learn.svelte.dev/tutorial/slots" rel="nofollow noreferrer">老虎机的课程</a>。最好参考该工具的文档。 Svelte 的学习网站非常棒。</p> <pre><code>// Slotted component, say Test.svelte. &lt;div class=&#34;private-parent&#34;&gt; &lt;slot /&gt; &lt;/div&gt; &lt;style&gt; div.private-parent { color: blue; } &lt;/style&gt; </code></pre> <p>然后,您使用该组件:</p> <pre><code>&lt;script&gt; import Test from &#39;./Test.svelte&#39;; &lt;/script&gt; &lt;Test&gt; &lt;!-- This is the slot&#39;s content --&gt; &lt;p class=&#34;outside-style&#34;&gt;Hello!&lt;/p&gt; &lt;/Test&gt; &lt;style&gt; p.outside-style { color: darkred; } &lt;/style&gt; </code></pre> </answer> </body></html>


在 .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 项目


© www.soinside.com 2019 - 2024. All rights reserved.