我已经为一些特定的响应创建了一些web api。编译良好,并在visual studio localhost上运行。无论我如何发布它,它都会给我一个错误,比如:
Warning 15 This label has not been referenced C:\MSSMS.infisms.co.in\MSSMS.infisms.co.in\App_Code\BulkSMS.cs 578 5 C:\MSSMS.infisms.co.in\MSSMS.infisms.co.in\这是我的服务代码:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class BulkSMS : System.Web.Services.WebService
{
public BulkSMS()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
#region Sendmessage
public string SendQuickMessage(string C_Name, string MobileNo, string Message, int AccountType, int Sender, int MessageType)
{
string Response = " ";// string.Empty;
try
{
int CharCount = CharMsgCount(Message, MessageType);
string[] Mobilenos = MobileNo.Split(',');
foreach (string Mobile in Mobilenos)
{
AppGlobal.Message message = new AppGlobal.Message();
message.intUserID = SiteUser.Current().UserID;
message.strC_Name = C_Name;
message.strMobileNo = Mobile;
message.strMessageText = Message;
message.intAccounttype = AccountType;
message.intSenderID = Sender;
message.intMessagetype = MessageType;
message.dtReceiveTime = DateTime.Now;
message.intCharCount = CharCount;
AppGlobal.Messagequeuq.Enqueue(message);
//Mysql.ExecuteNonQuery("BulkSMS_SendQuickMessage", SiteUser.Current().UserID, C_Name, Mobile, Message, AccountType, Sender, MessageType);
}
//Mysql.ExecuteNonQuery("BulkSMS_AddArchiveMessgae", SiteUser.Current().UserID, Message);
Response = "Success";
}
catch (Exception ex)
{
Response = "Error in BulkSMS_SendQuickMessage : " + MobileNo + " " + CommonMethods.GetErrorMessage(ex, "BulkSMS_AddArchiveMessgae");
}
**RESPONSE:// this line gives warning message not referenced label**
if (!string.IsNullOrWhiteSpace(Response))
AppGlobal.Logger.WriteToErrorLogFile(Response);
return Response;
}帮帮我吧伙计们..。
发布于 2019-09-13 16:51:50
原因是“标签没有被引用”。您必须在goto语句中使用创建的标签,如下所示
Response: // you have created a label with name "Response".
{
//your for loop is executed inside your label block.
}
goto Response;添加goto Response语句将禁用该警告。
https://stackoverflow.com/questions/55805734
复制相似问题