小编Leo*_*oue的帖子

.Net 6 Blazor 服务器端 CSS 隔离不起作用

我创建了一个新的 .NET 6 Blazor 服务器端项目并进行了一些更改。我有几个使用 CSS 隔离的文件(例如 Contact.razor + Contact.razor.css)。在 _Layout.cshtml 页面中,模板添加了以下内容:

<link href="CustomerPortal.styles.css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)

其中 CustomerPortal 是我的项目名称。我可以看到该文件在“CustomerPortal\CustomerPortal\obj\Debug\net6.0\scopedcss\projectbundle\CustomerPortal.bundle.scp.css”和“C:\Data\Git\WebApps\CustomerPortal\CustomerPortal\obj”下正确生成\Debug\net6.0\scopedcss\bundle\CustomerPortal.styles.css" 但是当我使用 Kernel 或 IIS Express 运行项目时,如果我尝试手动导航到 CSS,我会收到 404 未找到 CSS我也找不到。有任何想法吗?我的 csproj 没有任何会影响它的标志。

css blazor-server-side .net-6.0

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

Visual Studio Code Typescript 避免在新行上使用参数

我正在 Visual Studio Code 上开发一个 Angular 项目,并且在 Typescript 文件上遇到一个烦人的格式文档设置,它将参数中断为新行:

格式化之前(alt+shift+f):

this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get('assetid');
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get('collateralid');
Run Code Online (Sandbox Code Playgroud)

格式化后(alt+shift+f):

this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get(
  'assetid'
);
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get(
  'collateralid'
);
Run Code Online (Sandbox Code Playgroud)

我已关闭自动换行,但我仍然尝试将其设置为更大的自动换行列值。查看我当前的设置覆盖

{
   "git.confirmSync": false,
   "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
   "workbench.iconTheme": "material-icon-theme",
   "editor.formatOnSave": true,
   "prettier.singleQuote": true,
   "editor.wordWrapColumn": 180
 }
Run Code Online (Sandbox Code Playgroud)

typescript visual-studio-code angular

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

Visual Studio VSIX OnSolutionOpened无法正常工作

我正在尝试为Visual Studio实现某种起始页扩展。主要目的是通过每次打开解决方案时启动本地HTML文件,为我工作的公司中的特定项目提供指导和最佳实践。我从使用Visual Commander(https://vlasovstudio.com/visual-commander/extensions.html)开始,它非常好用。但是我想改为使其成为VSIX文件。经过一些研究后,我生成了代码,但是如果我调试或直接从debug文件夹安装vsix,则什么也不会发生(即使我在第一行抛出异常也不会)。代码很简单:

 #region Package Members

    DTE DTE;

    /// <summary>
    /// Initialization of the package; this method is called right after the package is sited, so this is the place
    /// where you can put all the initialization code that rely on services provided by VisualStudio.
    /// </summary>
    protected override void Initialize()
    {
        base.Initialize();
        try
        {
            IServiceContainer serviceContainer = this as IServiceContainer;
            DTE = serviceContainer.GetService(typeof(SDTE)) as DTE;
            EnvDTE.Events events = DTE.Events;
            EnvDTE.SolutionEvents solutionEvents = events.SolutionEvents;
            solutionEvents.Opened += OnSolutionOpened; …
Run Code Online (Sandbox Code Playgroud)

visual-studio vsix visual-studio-extensions

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