I have a web forms project which I've just ported to VS2015.
On the Master Page, I have the following public method which sets a response message:
public void SetResponse(string responseMessage, Utilities.ResponseType cssClass)
{
ResponseToUser.Text = !String.IsNullOrWhiteSpace(responseMessage) ? Utilities.GetResponse(responseMessage, cssClass) : "";
}
In the Utilities.cs file, I have the enum and the GetResponse:
namespace WEB
{
public class Utilities
{
public enum ResponseType
{
Success,
Info,
Warning,
Danger
}
public static string GetResponse(string message, ResponseType response)
{
return "<div id=\"response\" class=\"alert alert-" + response.ToString().ToLower() +
" fade in\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\">×</a>" + message + "</div>";
}
}
}
In the child pages, I make calls to the public method on the master page, like so:
if (Request.QueryString["msg"] == "changepassword")
Master.SetResponse("Please change your password before continuing", Utilities.ResponseType.Warning);
VS2015 is showing the Master.SetResponse
as an error, saying:
CS0012 The type 'Utilities.ResponseType' is defined in an assembly that is not referenced. You must add a reference to assembly 'App_Code.pay9mvri, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
At the top of the child page, I have the reference to the Utilities namespace:
using WEB;
So the ResponseType
enum IS in a referenced namespace. Why is it highlighting it as an error? The website still builds and runs fine, but I'd like to get rid of all the error messages. This wasn't an issue in VS2013 - the exact same project.