关闭已弃用的警告? [英] Turn off deprecated warnings?

查看:298
本文介绍了关闭已弃用的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Visual Studio 2005中关闭失效警告,

专业版?我已经将这个VB项目从2003版本移植到了b $ b到2005年,我已经有点谨慎了,因为已经无法移植代码了很多

,但是我收到了几百个警告

说的内容如下:


''公共函数添加(parameterName As String,value As Object)As

System.Data.SqlClient.SqlParameter''已过时:''Add(String

parameterName,Object value)已被弃用。使用

AddWithValue(String parameterName,Object value)。

http://go.microsoft.com/fwlink/?linkid=14202''


和他们之间的一些警告我真的很感兴趣。


我得到的其他常见警告是:


''公共函数GetPostBackEventReference(控制为

System.Web.UI.Control)因为字符串''已过时:''推荐的

替代方案是ClientScript.GetPostBackEventReference。


''Public Overridable Sub RegisterClientScriptBlock(key As String,script

As String)''已过时:''推荐替代方案是

ClientScript.RegisterClientScriptBlock(类型类型,字符串键,字符串

脚本)。

Marc Wentink

解决方案

是啊..回到2003年


或vb6


-Aaron
ma ********* @ hotmail .com 写道:


有没有办法在Visual Studio 2005中关闭失效警告,

专业版?我已经将这个VB项目从2003版本移植到了b $ b到2005年,我已经有点谨慎了,因为已经无法移植代码了很多

,但是我收到了几百个警告

说的内容如下:


''公共函数添加(parameterName As String,value As Object)As

System.Data.SqlClient.SqlParameter''已过时:''Add(String

parameterName,Object value)已被弃用。使用

AddWithValue(String parameterName,Object value)。

http://go.microsoft.com/fwlink/?linkid=14202''


和他们之间的一些警告我真的很感兴趣。


我得到的其他常见警告是:


''公共函数GetPostBackEventReference(控制为

System.Web.UI.Control)因为字符串''已过时:''推荐的

替代方案是ClientScript.GetPostBackEventReference。


''Public Overridable Sub RegisterClientScriptBlock(key As String,script

As String)''已过时:''推荐替代方案是

ClientScript.RegisterClientScriptBlock(类型类型,字符串键,字符串

脚本)。

Marc Wentink


哦,就这样放弃吧。


你的不断咆哮变得非常恼人。你对这些团体的帮助并不是很有用 - 你是一个障碍。


我一直在阅读你的帖子,我很坦率地失望那个声称拥有这么多知识的人没有什么可以帮助的。

其他人。你的帖子把你描绘成一个讨厌,粗鲁和放大的人。顽固的

人。


无论这是否真实,我们永远不会知道 - 这些团体不会想要这些团体中的任何人找出答案。


如果你是个好人,你可能想要#pragma禁用警告

boy / girl / martian并且我不想做全局禁用,但我不是确定VB中的等价物,因为我只是在c#中使用它。


有一个/ nowarn VB.Net编译器选项,但我不知道如何设置

它。


我也读过,在项目文件中,你可以找到像

这样的元素:

< NOWARN> ...在这里显示你的警告ID #s ...< / NOWARN>

发出警告#你进入那里应该停止漫游

:)


这是一个C#来源#pragma选项的(坏代码项目),如果

它有所帮助:
http://www.codeproject.com/debug/pragma_tips.asp


//安德鲁


Is there a way to turn off depreacted warnings in Visual Studio 2005,
Professional Edition? I''ve got this VB project ported from version 2003
to 2005, I am a bit cautious to already changing the code that much
that it could not be ported back, but I got a few hundred warnings
saying things like:

''Public Function Add(parameterName As String, value As Object) As
System.Data.SqlClient.SqlParameter'' is obsolete: ''Add(String
parameterName, Object value) has been deprecated. Use
AddWithValue(String parameterName, Object value).
http://go.microsoft.com/fwlink/?linkid=14202''

and a few warning between them I would really interested in.

The other frequent warnings I got are:

''Public Function GetPostBackEventReference(control As
System.Web.UI.Control) As String'' is obsolete: ''The recommended
alternative is ClientScript.GetPostBackEventReference.

''Public Overridable Sub RegisterClientScriptBlock(key As String, script
As String)'' is obsolete: ''The recommended alternative is
ClientScript.RegisterClientScriptBlock(Type type, string key, string
script).

Marc Wentink

解决方案

yeah.. move back to 2003

or vb6

-Aaron
ma*********@hotmail.com wrote:

Is there a way to turn off depreacted warnings in Visual Studio 2005,
Professional Edition? I''ve got this VB project ported from version 2003
to 2005, I am a bit cautious to already changing the code that much
that it could not be ported back, but I got a few hundred warnings
saying things like:

''Public Function Add(parameterName As String, value As Object) As
System.Data.SqlClient.SqlParameter'' is obsolete: ''Add(String
parameterName, Object value) has been deprecated. Use
AddWithValue(String parameterName, Object value).
http://go.microsoft.com/fwlink/?linkid=14202''

and a few warning between them I would really interested in.

The other frequent warnings I got are:

''Public Function GetPostBackEventReference(control As
System.Web.UI.Control) As String'' is obsolete: ''The recommended
alternative is ClientScript.GetPostBackEventReference.

''Public Overridable Sub RegisterClientScriptBlock(key As String, script
As String)'' is obsolete: ''The recommended alternative is
ClientScript.RegisterClientScriptBlock(Type type, string key, string
script).

Marc Wentink


Oh just give up will you.

Your incessant ramblings are becoming quite irritating. You are in no
way useful to these Groups what so ever - you are a hindrance.

I have been reading your posts and I am quite frankly disappointed that
someone who claims to have so much knowledge does nothing to help
others. Your posts portray you as an obnoxious, rude & stubborn
person.

Whether this is true or not we will never know - not that anyone in
these Groups would want to find out.


You probably want the #pragma that disables warnings if you are a good
boy/girl/martian and don''t want to do global disables, but I am not
sure what the equivalent in VB is since I''ve only don this in c#.

There is a /nowarn VB.Net compiler option, but I do not know how to set
it.

I have also read that, in the project file, you can find a element like
this :
<NOWARN>... bring out your warning id #s here ...</NOWARN>
Putting the warning # you are getting in there should stop the rambling
:)

Here is a C# source (the bad code project ) for the #pragma option, if
it helps somehow :
http://www.codeproject.com/debug/pragma_tips.asp

// Andrew


这篇关于关闭已弃用的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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