小编ton*_*9uk的帖子

如何打开magento错误消息?

我已经安装了Magento社区版,并尝试创建我的第一个简单的hello world模块.几个小时后,我终于开始工作了.

我的问题是我在一些XML标签中使用了不正确的套管.

在尝试使其工作时,我尝试加载页面显示未找到的消息,但没有错误.

我已经在管理控制面板中切换错误System > Configuration > Developer > Log Settings并写了一行,我知道应该抛出错误但我只是有一个空白的屏幕

  1. 如何在Magento中显示错误?
  2. 当我在xml文件中使用不正确的大小写时,它被认为是错误还是我不会收到错误消息的问题?如果是这样的话,我怎么能快速找到引起问题的文件(显然目前不是问题,但我可以想象,随着模块功能化,很难找到导致问题的单一套管问题问题)

magento

24
推荐指数
2
解决办法
6万
查看次数

属性X的类型为Y,当前数据库提供程序不支持该属性

我真的是EF的新手(使用EF core 2.1),并且到目前为止已经关注了很多教程,但是现在我开始创建自己的数据库结构,并在尝试向数据库中添加值时偶然发现:

private async Task<int> Insert()
{
    var address = new Address { AddressLine1 = "1 any street",  AddressLine2 = "", AddressLine3 = "", City = "Any city" };

    using (var context = new BranchContext())
    {
        context.Addresses.AddAsync(address);//ERROR HERE
        ....
    }
 }
Run Code Online (Sandbox Code Playgroud)

我收到错误:

InvalidOperationException:属性“ Branch.Address”的类型为“地址”,当前数据库提供程序不支持该类型。使用'[NotMapped]'属性或'OnModelCreating'中的'EntityTypeBuilder.Ignore'更改属性CLR类型或忽略该属性。

我创建了以下类:

public class Address
{
    public int Id { get; set; }
    public int Guid { get; set; }
    public DateTime CreatedOn { get; set; }
    public string Number { get; set; }
    public string …
Run Code Online (Sandbox Code Playgroud)

entity-framework ef-core-2.1

7
推荐指数
3
解决办法
1982
查看次数

显示来自Azure Blob容器的图像

我有一个ASP MVC应用程序,试图在其中显示已存储在Azure Blob存储中的图像。

当我返回字符串时,浏览器只是显示为损坏的图像。当我右键单击并“检查”并单击生成的URI时,我收到以下消息

BlobNotFound 指定的Blob不存在。RequestId:f7c32876-0001-013e-539d-dede28000000时间:2016-07-15T13:30:49.7560775Z

我已经下载Azure Storage Explorer并可以看到文件。我试图将容器上的访问级别更改为read access for blobs onlyno public access(但是我认为我在代码行中这样做了PublicAccess = BlobContainerPublicAccessType.Blob)。

如何显示存储中包含的图像?

public string Index()
    {
        CloudBlockBlob blob = GetBlobInContainer("blobContainerTjsContainer", "PS-ICON-120x120_140.jpg");
        return "<img src="+ blob.Uri.AbsoluteUri +" alt='PS Image'>";
    }

CloudBlockBlob GetBlobInContainer(string container, string fileName)
    {
        //use web.config appSetting to get connection setting .NET Framework's ConfigurationManager class can also be used for this
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
        //create the blob client
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
        //retrieve a …
Run Code Online (Sandbox Code Playgroud)

c# azure azure-storage azure-web-sites

6
推荐指数
1
解决办法
8039
查看次数

在 Azure Blob 存储上托管时如何使 Angular 路由正常工作

我创建了一个 Angular 应用程序,它使用延迟加载和标准角度路由设置,当我在本地运行该应用程序时,此设置运行良好。但是,当我尝试从 azure blob 存储提供服务时,我在应用程序中导航时收到 404 错误。

Azure 存储static site已启用,当我导航到根页面时,它会显示。

我需要实施哪些 Azure 配置才能解决此问题?

请注意:为了使这个问题尽可能简洁,我在代码下方添加了我的尝试。另外,我不确定哪些 Azure 配置适合添加,因此我将它们保留在请求之前。

应用程序路由.module.ts

    import { NgModule } from '@angular/core';
    import { RouterModule, Routes } from '@angular/router';
    
    const routes: Routes = [
      { path: '', loadChildren: () => import('./feature-modules/home/home.module').then(h => h.HomeModule) },
      { path: 'roadmap', loadChildren: () => import('./feature-modules/roadmap/roadmap.module').then(h => h.RoadmapModule) },
      { path: 'games', loadChildren: () => import('./feature-modules/games/games.module').then(h => h.GamesModule) },
      { path: 'locations', loadChildren: () => import('./feature-modules/locations/locations.module').then(h => h.LocationsModule) },
      { path: …
Run Code Online (Sandbox Code Playgroud)

azure-storage single-page-application angular

6
推荐指数
1
解决办法
1885
查看次数

jarfile /usr/local/bin/selenium-server-standalone-2.38.0.jar无效或损坏

我试图掌握unitTesting,并开始关注这个netTuts教程.在本教程中,您可以从此处下载javafile .然后移动该文件,然后使用

java -jar /usr/local/bin/selenium-server-standalone-2.38.0.jar

该文件旨在运行.

我的问题是我收到了消息

Invalid or corrupt jarfile /usr/local/bin/selenium-server-standalone-2.38.0.jar

我为解决这个问题所做的搜索谈到了人们创建自己的文件或下载出错的问题,因为文件大小应该比下载的大.我的34.6MB是我认为正确的.我还检查了我正在运行的Java版本(1.6.0_65),(这里说1.6+ 很好).

这似乎是一个常见问题,但我找不到任何解决方案.

java selenium

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

无法在字符串上创建属性"验证器"

我正在尝试创建一个Angular 5嵌套反应形式.

我开始创建一个平面形式,按预期工作,但只要我提取部分表单并将其作为子组件放置,我就会收到错误

错误TypeError:无法在字符串'addressFormGroup'上创建属性'validator'

如果我刚开始键入,则会在控制台中显示另一个错误

错误TypeError:this.form.get不是函数

我究竟做错了什么?我已经阅读了几个线程和教程来尝试解决这个问题,但我认为我错过了一些明显的东西.

import { Component, OnInit } from '@angular/core'
import { FormControl, FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Address } from '../Property';

@Component({
moduleId: module.id,
selector: 'app-property-form',
templateUrl: './property-form.component.html',
styleUrls: ['./property-form.component.css']
})
export class PropertyFormComponent implements OnInit {

propertyForm: FormGroup;

constructor(private _formBuilder: FormBuilder) {}

ngOnInit() {
    this.createForm();
}

createForm() {
    this.propertyForm = this._formBuilder.group({
        saleOrLet: ['Sales', Validators.required],
        addressFormGroup: this.initAddress()
    })
}

initAddress() {
    return this._formBuilder.group({
        houseNameNumber: '',
        address2: '',
        postCode1: '',
        postCode2: ''
    }) …
Run Code Online (Sandbox Code Playgroud)

angular angular-forms angular5

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

错误:无法解析'@ angular/compiler/src/core'

我正在尝试学习Angular 5,在完成几个教程后,我购买了一个模板来帮助我学习如何构建我的应用程序.

我正在尝试添加我自己的模块,同时遵循我购买的这个模板的结构,但我收到以下消息.

./src/app/pages/property/property.component.ts中的错误找不到模块:错误:无法解析'....\myProject\src\app \中的'@ angular/compiler/src/core'网页\财产"

在此输入图像描述

我的模块肯定存在于该位置,所以我觉得我误解了如何引用模块和组件以及如何使用路由.

我认为在这里尝试和获得帮助的最佳方式是引导您完成我认为/应该发生的事情.

的index.html

在这种情况下,index.html使用选择器az-root调用组件 app.component

...other stuff...
<az-root></az-root>
...other stuff...
Run Code Online (Sandbox Code Playgroud)

app.component.ts

显示routes属性中定义的默认页面app.routing.ts

...some imports...
@Component({
  selector: 'az-root',
  encapsulation: ViewEncapsulation.None,
  template:`<router-outlet></router-outlet>`,
  styleUrls: ['./app.component.scss']
})
export class AppComponent { }
Run Code Online (Sandbox Code Playgroud)

app.routing.ts

加载位于的页面模块 app/pages/pages.module.ts

...some imports...
export const routes: Routes = [
  { path: '', redirectTo: 'pages', pathMatch: 'full' },
  { path: 'pages', loadChildren: 'app/pages/pages.module#PagesModule' },
  { path: '**', component: ErrorComponent }
];
...other stuff...
Run Code Online (Sandbox Code Playgroud)

PagesModule

我不确定如何PagesModule定义PagesComponent因为PagesComponent …

angular

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

仅在@ Html.EditorFor帮助器中显示日期

我正在尝试填充@Html.EditorFor助手.我创建了一个具有以下属性的视图模型

[DataType(DataType.Date, ErrorMessage="Date only")]
[DisplayFormat(DataFormatString = "{0:dd/MM/yy}", ApplyFormatInEditMode = true)]
public DateTime? YearBought { get; set; }
Run Code Online (Sandbox Code Playgroud)

我的助手设置如下(a)

@Html.ValidationMessageFor(m => m.YearBought)
@Html.EditorFor(model => model.YearBought, new { @type = "date" })
Run Code Online (Sandbox Code Playgroud)

我也试过(二)

@Html.ValidationMessageFor(m => m.YearBought)
@Html.EditorFor(model => model.YearBought.Value.Date)
Run Code Online (Sandbox Code Playgroud)

使用上述格式(a)不显示任何内容.使用上述格式(b)12/05/2014 00:00:00以文本框格式显示.

我试图实现一个没有时间显示的datepicker格式

我已经回顾了其他几个问题但是看不出我做了什么不同.

当我查看我的数据库时,值保存为2014-05-12,当我保存值时,EditorFor帮助程序生成所需的输入工具

问题已审核

第一个 第二个 第三 ......列表继续

编辑刚刚在chrome dev工具中打开控制台,所以这条消息

指定值"12/05/14"不符合所需格式,"yyyy-MM-dd"

我以为DisplayFormat(DataFormatString = "{0:dd/MM/yy}"是在定义如何显示我的约会?

asp.net-mvc asp.net-mvc-4

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

解决在上下文中找不到owin.Environment项目

我发现很多线程正在讨论这个问题,但是到目前为止,让它们中的任何一个都无法工作.

我一直在尝试关注ProDinner,以此来学习如何在我的应用中实现基于角色的身份验证.但我无法解决我所缺少的问题.我每次尝试登录都会得到

在上下文中找不到owin.Environment项

经过大量的调试和搜索,我发现这个Startup类没有被调用.我试图通过逐步调试proDinner代码来解决,如何Startup被调用和googled(很多!).我的搜索引导我添加(虽然在proDinner项目中都不存在)

<add key="owin:AutomaticAppStartup" value="Tjs.Startup, Tjs" />
Run Code Online (Sandbox Code Playgroud)

然后

<add key="owin:AutomaticAppStartup" value="Tjs.Web.Admin.Startup, Tjs" />
Run Code Online (Sandbox Code Playgroud)

下面我添加了我认为相关代码的所有内容,但如果我遗漏了任何内容,请告诉我.

AccountController是ProDinner的复制粘贴,添加了无参数构造函数,我无法确定如何在Prodinner项目中传递该参数(可能是问题吗?)

Tjs:解决方案名称

Tjs.Web.Admin:名称空间

Owin包

<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" />
Run Code Online (Sandbox Code Playgroud)

项目的根源

using Microsoft.Owin;
using Owin;

using Tjs.Web.Admin;
using Tjs.Web.Admin.App_Start;

[assembly: OwinStartup(typeof(Startup))]
namespace Tjs.Web.Admin
{
  public class Startup
  {
    public void Configuration(IAppBuilder app)
    {
        OwinConfig.ConfigureAuth(app);
    }
  }
} …
Run Code Online (Sandbox Code Playgroud)

c# authentication asp.net-mvc owin

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

如何测试流畅的验证错误消息

我正在尝试掌握 TDD,我已经查看了一些教程,并尝试对我使用 fluent 验证创建的验证类实施测试。

public SomeFormValidator()
{
        RuleFor(x => x.MyClass).NotNull()
            .WithMessage("MyClass cannot be null");
}
Run Code Online (Sandbox Code Playgroud)

我查看了专门用于流畅验证的 TDD 示例并创建了几个测试

    [Test]
    public void Should_have_error_when_MyClass_is_null()
    {
        MyClass myClass = null;
        SomeFormValidator.ShouldHaveValidationErrorFor(aup => aup.MyClass, myClass);
    }

    [Test]
    public void Should_not_have_error_when_MyClass_is_not_null()
    {
        MyClass myClass = new MyClass();
        SomeFormValidator.ShouldNotHaveValidationErrorFor(aup => aup.MyClass, myClass);
    }
Run Code Online (Sandbox Code Playgroud)

我现在想测试字符串“MyClass 不能为空”在它为空时返回。我无法找到任何涵盖返回消息的内容,也无法解决。

tdd fluentvalidation

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