小编Sol*_*id1的帖子

如何解决“未找到 .NET SDK”的问题。错误--VSCode

我正在尝试在本地计算机上设置后端我已经安装了 v6 dotnet 一切都已安装,但是当我运行时dotnet run 出现此错误

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'run' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
Run Code Online (Sandbox Code Playgroud)

点网--信息

PS C:\Users\Az\bazaar-online\Server\Src\BazaarOnline.API> dotnet --info

global.json file:
  Not found

Host:
  Version:      6.0.7
  Architecture: x86
  Commit:       0ec02c8c96

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net .net-core visual-studio-code

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

为什么我的 try catch 块不会执行?- 反应

我有一个注册模式,有 3 个步骤。

填写信息、获取激活码和成功消息。

我希望当用户填写输入并单击提交按钮时,如果没有错误,则移动到下一步,但如果有错误,则会React Toastify显示消息。

我的问题是为什么try catch阻止MyComponent不起作用?

PS:我正在使用FormikYup

http服务

const handleExpectedError = (response: any) => {
  if (response?.status >= 400 && response?.status < 500) {
    const errors = response?.data?.errors;
    const errPropertyName: string[] = Object.keys(errors);
    toast.error(errors?.[errPropertyName?.[0]]?.[0]);
  }
};

export const handleRegister = async (user: User): Promise<void> => {
  try {
    await axios.post(`${config.apiEndPoint}/auth/register`, user, header);
  } catch ({ response }) {
    handleExpectedError(response);
  }
};
Run Code Online (Sandbox Code Playgroud)

我的组件

  const [step, setStep] = useState(1);
  const formik …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs next.js react-hooks

-1
推荐指数
1
解决办法
1418
查看次数