我已将代码从 dotnet 6 更新到 dotnet 7。它可以构建,并且在我运行它之前一切看起来都很好。然后我收到错误消息:
Uncaught SyntaxError: Cannot use 'import.meta' outside a module (at dotnet.7.0.0.amub20uvka.js:8:27)
有任何想法吗?
所以我尝试在我的 React 应用程序上为 Material-Ui 配置主题。在应用程序中,我使用两种不同类型的按钮:包含按钮和轮廓按钮。问题是所包含按钮上的悬停效果(概述的效果很好),并且默认为灰色悬停效果。
overrides: {
MuiButton: {
contained: {
backgroundColor: palette.primary.main,
color: palette.primary.contrastText,
"&:hover": {
backgroundColor: palette.primary.active,
},
},
outlined: {
color: palette.primary.main,
"&:hover": {
backgroundColor: palette.primary.active,
},
},
}
}
Run Code Online (Sandbox Code Playgroud)
概述=工作
包含=不工作
这是来自元素检查器,其中我的颜色是带有删除线的
背景颜色:
#e0e0e0.MuiButton-contained:hover
rgba(23, 0, 255, 0.3).MuiButton-contained:hover
有人知道出了什么问题吗?
我正在 Material-UI 中创建一个主题,并且必须使用我们自己的一组图标 (SVG)。但是,当插入带有startIcon/的按钮时,图标会变得太小endIcon。有什么方法可以增加图标的大小而不是字体。最好从主题设置。
这是按钮的示例:https :
//codesandbox.io/s/inspiring-spence-gsov0?file=/src/App.js
import React from "react";
import "./styles.css";
import Button from "@material-ui/core/Button";
import { SvgIcon } from "@material-ui/core";
function CloudIcon(props) {
return (
<SvgIcon {...props}>
<svg viewBox="0 0 94 94" {...props}>
<title>{"B Circle"}</title>
<circle cx={47} cy={47} r={47} fill="#1700ff" />
<title>{"\uF0C2"}</title>
<path
d="M61.9 61.6h-29c-6.3 0-11.3-5.1-11.3-11.3 0-5 3.2-9.3 7.9-10.8.2-7.2 6.2-13.1 13.5-13.1 4.4 0 8.4 2.1 10.9 5.6 1.2-.6 2.5-.9 3.9-.9 5.1 0 9.3 4.2 9.3 9.3 0 .5 0 1-.1 1.5 3.3 …Run Code Online (Sandbox Code Playgroud) 今天早上用VS2019建了一个项目。决定升级到VS2022,现在构建失败。
通过 VS 构建给我错误:
The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft'
Run Code Online (Sandbox Code Playgroud)
通过终端构建时,我收到一个稍微更详细的错误。
首先这个警告
C:\Program Files\dotnet\sdk\6.0.100\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.Storage". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Run Code Online (Sandbox Code Playgroud)
然后同样的错误。
如上所述。唯一改变的是 Visual Studio 的版本。
我也收到第二个错误。
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration …Run Code Online (Sandbox Code Playgroud) 将代码更新到 .Net 7 后,登录后的重新路由将转到根“/”,而不是请求的 URL。
我们使用 Azure Ad 和 MSAL 来验证 Blazor WebAssembly 应用中的用户。AD 有一个返回 URI /authentication/login-callback。当用户未经授权时,用户将被重定向:
NavigationManager.NavigateTo($"authentication/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}");
示例:
https://localhost:44395/authentication/login?returnUrl=https%3A%2F%2Flocalhost%3A44395%2Ftest应该让我返回,https://localhost:44395/test但我最终到达https://localhost:44395/
正如我所说,问题仅在运行 .Net 7 时出现。当我切换回 .Net 6 时,一切正常。
我想我在发行说明中遗漏了一些东西。但我一直没能查出是什么。