GVKun编程网logo

托pipe的System :: Diagnostics :: Debugger :: Launchfunction的非托pipe/本机替代scheme?

24

本文的目的是介绍托pipe的System::Diagnostics::Debugger::Launchfunction的非托pipe/本机替代scheme?的详细情况,我们将通过专业的研究、有关数据的

本文的目的是介绍托pipe的System :: Diagnostics :: Debugger :: Launchfunction的非托pipe/本机替代scheme?的详细情况,我们将通过专业的研究、有关数据的分析等多种方式,同时也不会遗漏关于$("#SpecialAptitude").on("change",function(){CheckType($(this))})$("#Spe...、asp.net – system.web.compilation.debug与system.codedom.compilers.compiler.compilerOptions / define:Debug = True、Azure 功能:启动外部 System.Diagnostic.Process 并通过 Namedpipes 使用 GRPC for IPC、c# – System.Diagnostics.Debugger.Debug()停止工作的知识。

本文目录一览:

托pipe的System :: Diagnostics :: Debugger :: Launchfunction的非托pipe/本机替代scheme?

托pipe的System :: Diagnostics :: Debugger :: Launchfunction的非托pipe/本机替代scheme?

我有一个混合模式的应用程序,如果在内部数据结构中发现错误,我想启动debugging器。 奇怪的是,DebugBreak和__debugbreak函数似乎没有按预期工作(.Net框架似乎拦截断点exception,导致各种令人讨厌的副作用)。

我以前的问题的解决scheme(请参阅DebugBreak的行为不同于非托pipe和混合(非托pipe+托pipe)应用程序? )似乎适用于非常简单的情况,但不是在我的应用程序(它只是让我的应用程序挂起)。

幸运的是,我发现执行System::Diagnostics::Debugger::Launch似乎解决了这个问题。 然而,我需要有这个逻辑的地方在混合模式的应用程序中都用于非托pipe。 另外,在我想放置逻辑的地方调用托pipe代码是相当困难的。

因此:是否有System::Diagnostics::Debugger::Launch函数的非托pipe替代方法?

创build快捷方式会修改目标path

C#将32bpp图像转换为8bpp

使用命令行csc.exe创build一个C#可移植类库?

如何在C#中监视Fileaccess

获取txt文件的标准应用程序(.NET)

如何清除列表框中的所有数据?

从其hex数中获取Windows系统错误代码标题/说明

依次读取大量的小文件

强制Windows显示系统托盘图标

如何使用C#/ .NET代码获取ClickOnce应用程序path和版本号?

在我看来System :: Diagnostics :: Debugger :: Launch的使用是一个很好的观点。 .NET调试器像其他一些.NET类也有非托管接口 ,例如ICorDebug :: DebugActiveProcess 。 在我看来,你应该尝试使用它。 你可以在http://msdn.microsoft.com/en-us/magazine/cc301510.aspx上阅读更多关于这方面的内容。 这是行不通的,你可以尝试写一个你自己的小型COM接口,只有一个调用System::Diagnostics::Debugger::Launch 。

另一种方法是使用即时调试和如何:自动启动调试器 。

如果您不需要调试应用程序的启动代码,则可以非常简单的方式执行所需操作:在主线程(或者您想要调试的所有线程)中的应用程序开始处,可以显示消息框。 看到消息框后,可以以管理员身份启动Visual Studio,然后使用“调试”/“附加到进程…”。 它工作得很好。 如果你想调试Windows服务,你应该使用WTSSendMessage而不是MessageBox 。 我使用这种方式,因为多年,它的工作完美。

_asm int 3; // I need to enter this to satisfy StackOverflow minimal answer length requirement

$(

$("#SpecialAptitude").on("change",function(){CheckType($(this))})$("#Spe...

$("#SpecialAptitude").on("change",function(){CheckType($(this))})$("#SpecialAptitude").on("change",CheckType($(this)))

为什么第一个有效果 第二个没效果呢

实际上两种都是可以的

 

 

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
</head>
<body>
<button>a</button>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select Id="S2">
<option>a1</option>
<option>a2</option>
<option>a3</option>
<option>a4</option>
</select>
</body>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
function notify() {
  alert( "clicked111" );
}
function notify2() {
  alert( "clicked222" );
}
function notify3() {
  alert( "clicked2223" );
}
$("button").on( "click", notify);
$("select").on( "change", notify2);
$("#S2").on( "change", function(){notify3()});
</script>
</html>

 

 都行

$("#SpecialAptitude").on("change",CheckType($(this)))

只是不能加()

 

 

要想加 参数

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
</head>
<body>
<button>a</button>
<select id="s1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select Id="S2">
<option>a1</option>
<option>a2</option>
<option>a3</option>
<option>a4</option>
</select>
</body>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
function notify() {
  alert( "clicked111" );
}


$("button").on( "click", notify);
$("#s1").on( "change",{
  name: "Karl"
},notify2);
$("#S2").on( "change", function(){notify3()});
function notify2(a) {
  alert( "clicked222"+a.data.name );
}
function notify3() {
  alert( "clicked2223" );
}
</script>
</html>

 

asp.net – system.web.compilation.debug与system.codedom.compilers.compiler.compilerOptions / define:Debug = True

asp.net – system.web.compilation.debug与system.codedom.compilers.compiler.compilerOptions / define:Debug = True

当我将ASP.NET Web应用程序部署到生产环境时,我使用配置转换从< compilation>中删除debug =“true”.但是,就在今天我注意到web.config中的另一个部分如下所示:
<system.codedom>
    <compilers>
        <compiler compilerOptions="/define:Debug=True" />
    </compilers>
</system.codedom>

这是什么?事实是,那就是打败了从< compilation>中删除它的目的吗?如果我删除上面显示的属性会怎样?

解决方法

Is the fact that that’s there defeating the purpose
of removing it from <compilation>

从MSDN C# Compiler Options起
要打开调试,编译器上的标志是/ debug而不是/ define:Debug = True

/debug : Instruct the compiler to emit debugging information.
/define : Defines preprocessor symbols.

因此,当您定义Debug = True时,您只能将此情况设为true:

#if DEBUG == true
// Compile what is inside here !
#endif

/ define:Debug = True不会添加任何其他调试信息,除非您使用上述代码手动包含它们.

测试页面

我使用以下代码进行测试,看看发生了什么.

txtDebug.Text = HttpContext.Current.IsDebuggingEnabled.ToString();

    #if DEBUG
    txtDebug.Text +=  "<br>defined Debug is on";
    #endif
    #if DEBUG == true
    txtDebug.Text +=  "<br>defined Debug = true is on";
    #endif

结果1

现在,如果debug =“false”并且使用compilerOptions =“/ define:Debug = True”,结果是

false
defined Debug = true is on

结果2

如果debug =“true”和compilerOptions =“/ define:Debug = True”结果是

true
defined Debug is on
defined Debug = true is on

结果3

现在我再做一次测试,我在web.config上添加了这一行

<compiler language="c#;cs;csharp" extension=".cs" 
    compilerOptions="/define:Debug=True /D:DEBUG,TESTFLAG" 
   type="Microsoft.CSharp.CSharpCodeProvider,System,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" 
       warningLevel="4" />

结果是debug = false

False (debug is false)
defined Debug is on (but the defined DEBUG Now is runs)
defined Debug = true is on (This is also runs)
test flag (but the defined extra flag is also runs)

MSDN

看看MSDN for the /define (Preprocessor Definition)我看那个宣言

/define:Debug=True

只适用于这种代码的情况

#if DEBUG == true
txtDebug.Text +=  "<br>defined Debug = true is on";
#endif

Azure 功能:启动外部 System.Diagnostic.Process 并通过 Namedpipes 使用 GRPC for IPC

Azure 功能:启动外部 System.Diagnostic.Process 并通过 Namedpipes 使用 GRPC for IPC

如何解决Azure 功能:启动外部 System.Diagnostic.Process 并通过 Namedpipes 使用 GRPC for IPC?

对于一些上下文,我使用 Azure Functions 来执行一些静态方法,这些方法使用来自动态加载(有点插件系统)到 AppDomain 的程序集的反射。

第一种方法是使用 Nate McMaster 的 DotNetCorePlugings 来确保卸载程序集,但由于使用 Json.Net 执行期间的某些处理,无法卸载程序集(Json.Net 将类型缓存保持在防止卸载的私有静态 ConcurrentDictionary<Type,JsonContract>)。

由于无法在进程内完成执行以确保之后卸载程序集,因此我决定创建一个小型控制台应用程序来托管 ASP.NET wen 主机,该应用程序将作为新的 System.Diagnostic.Process 开始执行。我在命名管道上使用 GRPC(感谢这个操作系统项目 https://github.com/cyanfish/grpc-dotnet-namedpipes),在学习了几天 GRPC 和所有爵士乐之后,我让它在本地运行良好。

我的问题是它在部署后似乎在 Azure Functions 中不起作用。我花了一整天的时间试图弄清楚并得出结论,也许在 Azure 函数中 NamedPipes 没有以某种方式启用。

添加日志记录,我可以确认外部进程启动并正在等待来自 GRPC 客户端的消息,但似乎 namedpipe 服务器从未初始化:

2021-05-31T16:44:58.7796226+00:00  [INF] Now listening on: "http://[::1]:49321" (d826f4b8)
2021-05-31T16:44:58.8161119+00:00  [INF] Application started. Press Ctrl+C to shut down. (dcaefe54)
2021-05-31T16:44:58.8161965+00:00  [INF] Hosting environment: "Production" (c3307c92)
2021-05-31T16:44:58.8162301+00:00  [INF] Content root path: "D:\local\Temp\e4a5e40b-398c-4a49-88d3-aef6c31b536d" (b5d60022)

我想我的问题是:我们可以在 Azure 函数中使用命名管道吗?如果是这样,如何?我缺少一些配置吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

c# – System.Diagnostics.Debugger.Debug()停止工作

c# – System.Diagnostics.Debugger.Debug()停止工作

我正在使用一个使用System.Diagnostics.Debugger.Break()方法的程序来允许用户从命令行设置断点.这已经好几个星期了.但是,当我今天正在修复单元测试时,我尝试使用命令行中的调试开关,但它没有起作用.

这是我试过的:

>我已经确认Debug()方法真的被调用(通过在它之后放置一个System.Console.WriteLine())
>我已经确认该版本仍在Debug中
>我做了一个干净的构建
>我重新启动了Product Studio

一个快速的Google搜索没有显示任何内容,而.Net的api文档没有提及任何关于此功能无法正常执行的操作.所以…任何想法?

解决方法

我终于明白了发生了什么.由于某些原因,我的机器上发生了一些变化,所以调用Debugger.Debug已经不够了(仍然不明白什么改变了).无论如何,我现在可以通过使用以下命令来调试器:
if (Debugger.IsAttached == false) Debugger.Launch();

关于托pipe的System :: Diagnostics :: Debugger :: Launchfunction的非托pipe/本机替代scheme?的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于$("#SpecialAptitude").on("change",function(){CheckType($(this))})$("#Spe...、asp.net – system.web.compilation.debug与system.codedom.compilers.compiler.compilerOptions / define:Debug = True、Azure 功能:启动外部 System.Diagnostic.Process 并通过 Namedpipes 使用 GRPC for IPC、c# – System.Diagnostics.Debugger.Debug()停止工作等相关内容,可以在本站寻找。

本文标签: