Sha*_*ann -1 c# unreachable-code
本地一切正常,但出现“无法检测到代码”错误。
这是这段代码:
private string GetRedirectUriForCurrentConfiguration()
{
#if (DEBUG || DebugDev)
return "http://localhost:1855/";
#endif
return "http://172.16.40.39:1855";
}
Run Code Online (Sandbox Code Playgroud)
我在第四行收到“无法访问”消息 return "http://172.16.40.39:1855";
此语句设置正确吗?
只需#else在代码中添加预处理器指令即可:
private string GetRedirectUriForCurrentConfiguration() {
#if (DEBUG || DebugDev)
return "http://localhost:1855/";
#else
return "http://172.16.40.39:1855";
#endif
}
Run Code Online (Sandbox Code Playgroud)