小编jgi*_*l09的帖子

处于调试模式时的 Application Insights

我刚刚在 MVC 应用程序中启用了 Application Insights,并注意到在本地调试时,跟踪信息会在我的 Azure Application Insight 中捕获。

处于调试模式时,我想阻止应用程序在 Azure Application Insight 中记录事件,但仍会在 Visual Studio 的“诊断工具”>“事件”窗口中显示事件和日志记录信息。

我已尝试以下操作,虽然这会阻止在我的 Azure AI 中捕获事件,但 Visual Studio 不再在“事件”窗口中显示调试信息。

 protected void Application_Start()
 {
        #if DEBUG
        TelemetryConfiguration.Active.DisableTelemetry = true;
        #endif
 }
Run Code Online (Sandbox Code Playgroud)

我上网寻找答案无济于事。希望有人能帮忙。

c# azure azure-application-insights visual-studio-2015

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

Automapper - 缺少类型映射配置或不受支持的映射

已经为此苦苦挣扎了一天,但毫无结果。我是 Automapper 的新手,我正在尝试使用 viewModel 映射 EF 域对象,但收到以下异常:

Missing type map configuration or unsupported mapping.\r\n\r\nMapping types:\r\nCatalogueDefinitionFile -> CatalogueDefinitionFileViewModel\r\nDigital.PriceBuilder.Core.Domain.CatalogueDefinitionFile -> Digital.PriceBuilder.Web.Models.CatalogueDefinitionFileViewModel"}
Run Code Online (Sandbox Code Playgroud)

CatalogueDefinitionFile 的域 POCO 是:

public class CatalogueDefinitionFile : BaseEntity
{
    public CatalogueDefinitionFile()
    {
        this.ProductDefinitions = new List<ProductDefinition>();            
    }

    public string TargetApplication { get; set; }

    public virtual IList<ProductDefinition> ProductDefinitions { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

基础实体:

public abstract class BaseEntity
{
    public BaseEntity()
    {
        this.CreatedDate = DateTime.Now;
        this.UpdatedDate = DateTime.Now;
        this.IsActive = true;
    }

    public int Id { get; set; }

    public …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc entity-framework automapper

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