小编Ced*_*all的帖子

将 blazor 应用程序更新到 dotnet 7 时出现“import.meta”错误

我已将代码从 dotnet 6 更新到 dotnet 7。它可以构建,并且在我运行它之前一切看起来都很好。然后我收到错误消息: Uncaught SyntaxError: Cannot use 'import.meta' outside a module (at dotnet.7.0.0.amub20uvka.js:8:27)

有任何想法吗?

blazor .net-7.0

14
推荐指数
2
解决办法
2672
查看次数

Material-Ui 主题定制:将鼠标悬停在包含的按钮上

所以我尝试在我的 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

有人知道出了什么问题吗?

javascript reactjs material-ui

8
推荐指数
2
解决办法
1万
查看次数

更改 startIcon / endIcon Material-UI 的大小

我正在 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)

jsx reactjs material-ui

5
推荐指数
1
解决办法
2039
查看次数

更新到 VS 2022 后无法构建

今天早上用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 visual-studio-2022

4
推荐指数
1
解决办法
3242
查看次数

更新到 .Net 7 后,登录 Blazor 应用后的 MSAL 回调不会重新路由以返回 URI

将代码更新到 .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 时,一切正常。

我想我在发行说明中遗漏了一些东西。但我一直没能查出是什么。

.net azure-ad-msal blazor

4
推荐指数
1
解决办法
1355
查看次数