编译NetMQ时出错,
internal class IpcAddress : Address.IZAddress
{
private string m_name;
public override string ToString()
{
if (m_name == null)
return string.Empty;
return Protocol + “://” + m_name;
}
public void Resolve(string name, bool ip4Only)
{
m_name = name;
int hash = name.GetHashCode();
if (hash < 0)
hash = -hash;
hash = hash%55536;
hash += 10000;
Address = new IPEndPoint(IPAddress.Loopback, hash);
}
public IPEndPoint Address { get; private set; }
public string Protocol => Core.Address.IpcProtocol;//错误为:类、结构或接口成员声明中的标记“=>”无效
}
问一下该怎么样解决
internal class IpcAddress : Address.IZAddress
{
private string m_name;
public override string ToString()
{
if (m_name == null)
return string.Empty;
return Protocol + “://” + m_name;
}
public void Resolve(string name, bool ip4Only)
{
m_name = name;
int hash = name.GetHashCode();
if (hash < 0)
hash = -hash;
hash = hash%55536;
hash += 10000;
Address = new IPEndPoint(IPAddress.Loopback, hash);
}
public IPEndPoint Address { get; private set; }
public string Protocol => Core.Address.IpcProtocol;//错误为:类、结构或接口成员声明中的标记“=>”无效
}
问一下该怎么样解决
解决方案
15
这是C#6的语法。你要用VisualStudio2015来编译。
5
嗯,是本人才疏学浅,c#6.0的新特性,所以你得装个2015才行
Expression Bodied Functions and Properties