c# – 当前上下文中不存在名称“匹配”

c# – 当前上下文中不存在名称“匹配”,第1张

概述我有这个代码: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace RegexTest{ class Program { static void Ma 我有这个代码:

using System;using System.Collections.Generic;using System.linq;using System.Text;using System.Text.RegularExpressions;namespace RegexTest{    class Program    {        static voID Main(string[] args)        {            string str = "The quick brown fox.";            string pat = "fox";            Regex rgx = new Regex(pat,RegexOptions.IgnoreCase);            Match matches = rgx.Match(str);            Console.ReadKey();        }    }}

它编译并运行没有错误.
我在Console.ReadKey()设置了一个断点,因为我想检查变量匹配.
但是我收到了我在这个帖子标题中输入的奇怪错误信息.
网络上并不清楚它的含义.

@R_403_6120@ 如果您在Optimize Code上进行了切换,那么变量匹配就会被优化掉.如果您当前的构建配置文件是RELEASE,通常就是这种情况.将其更改为DEBUG,然后不使用代码优化,您可以访问所需的变量. 总结

以上是内存溢出为你收集整理的c# – 当前上下文中不存在名称“匹配”全部内容,希望文章能够帮你解决c# – 当前上下文中不存在名称“匹配”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1219596.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-05
下一篇2022-06-05

发表评论

登录后才能评论

评论列表(0条)

    保存