Visual Studio找不到Stringbuilder [英] Stringbuilder not found by visual studio

查看:482
本文介绍了Visual Studio找不到Stringbuilder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Visual Studio Community Edition C#开发一个小型测试WinForms应用程序。我需要使用之前已经使用过很多次的StringBuilder类。虽然我有一个使用System.Text,但VS找不到StringBuilder事件。声明。我最近将Visual Studio更新为15.7.5。这可能是原因。任何人都有修复的想法。



我尝试过:



我尝试使用相同的结果 -

即System.Text.StringBuilder sb = new ...



我搜索了MSDN支持和论坛并没有发现任何相关内容。

I started developing a small test WinForms application using Visual Studio Community Edition C#. I need to use the StringBuilder class, that I have used many times before. VS could not find StringBuilder event though I had a "using System.Text;" statement. I recently updated Visual Studio to 15.7.5. This may be cause. Anybody have ideas on a fix.

What I have tried:

I tried explicit with same results --
i.e. System.Text.StringBuilder sb = new ...

I searched MSDN support and forums and found nothing pertinent.

推荐答案

System.Text内置于mscorlib中。无论如何,这是一个始终存在的参考。你不能改变它或删除它,所以....



尝试进入你的项目属性并将目标框架版本更改为高于一个它设置,然后在出现的对话框上点击是。



你可以留在那里,或者,一旦你在新的编译应用程序之一版本,将其更改回旧版本并再次尝试。
System.Text is built into mscorlib. It's a reference that is always there, no matter what. You can't change it or delete it, so....

Try going into your Project Properties and changing the Target Framework version to a different version higher than the one it's set for, then hit "Yes" on the dialog that comes up.

You can either leave it there or, once you compile the app one under the new version, change that back to the old version and try it again.


我刚刚尝试过,它有效,



I just tried and it worked,

using System.Text;




StringBuilder sb = new StringBuilder(text);


我回去创建了一个新的Windows Forms App(.NET Framework),它可以工作。

我必须第一次创建错误,虽然我无法在项目属性中识别。
I went back and created a new "Windows Forms App (.NET Framework)" and it works.
I must have created incorrectly the first time, although I could not identify in the Project Properties.


这篇关于Visual Studio找不到Stringbuilder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆