我将为我的Datawarehouse应用程序应用微服务.应用中有4个主要的微服务:
1)数据服务:将外部数据源导入/导出到DWH,并从DWH查询数据.
2)分析服务:用于UI上的图表可视化
3)机器学习:用于推荐系统
4)报告:报告生成
图如下:
每个服务都有自己的DB,它们通过TCP和Thift序列化直接相互通信.这里的问题是数据服务遭受来自其他服务的高负载,并且可以成为应用程序的SPOF.DWH中的数据也很大(可能高达数百个记录).在这种情况下如何避免数据服务的瓶颈?或者我如何定义一个适当的有界上下文来避免瓶颈?
截至2016年3月31日发布在Xamarin博客中
截至今天,我们将Visual Studio中的Xamarin包括在内,无需额外费用.Xamarin将出现在Visual Studio的每个版本中,包括广泛可用的Visual Studio Community Edition,它可供个人开发人员,开源项目,学术研究,教育和小型专业团队免费使用.使用C#或F#直接在Visual Studio中开发和发布适用于iOS和Android的本机应用程序,对应用程序大小没有限制.
我已经在Windows 10上使用Alpha通道安装了最新版本的Xamarin,并在VS Community 2015中创建了新的Blank App(Xamarin.Forms Portable).
项目正在建设,但在模拟器上部署IOS项目我看到以下错误:
User code size, 1418240 bytes, is larger than 131072 bytes and requires
a??Business??(or higher) license. App1.iOS
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
最近我创建了一个新的ASP.NET核心Web应用程序,我的一个要求是为客户端公开一个端点,以获取存储在.resx文件中的所有转换键和值.
在ASP.NET Core之前我能够做到这样的事情.但该命令ResourceManager.GetResourceSet()不再被识别:
public IActionResult Get(string lang)
{
var resourceObject = new JObject();
var resourceSet = Resources.Strings.ResourceManager.GetResourceSet(new CultureInfo(lang), true, true);
IDictionaryEnumerator enumerator = resourceSet.GetEnumerator();
while (enumerator.MoveNext())
{
resourceObject.Add(enumerator.Key.ToString(), enumerator.Value.ToString());
}
return Ok(resourceObject);
}
Run Code Online (Sandbox Code Playgroud)
是否有任何新方法可以获取ASP.NET Core Project中资源的所有键和值?
我在ASP.NET Core 1.1解决方案中使用配置绑定。基本上,我在ConfigureConfigs Startup部分中有一些用于绑定的简单代码,如下所示:
services.AddSingleton(Configuration.GetSection("SettingsSection").Get<SettingsClass>());
Run Code Online (Sandbox Code Playgroud)
麻烦的是,我的类作为int属性,通常绑定到配置文件中的int值,但可以绑定到字符串“ disabled”。在幕后,如果绑定到字符串“ disabled”,我希望该属性的值为-1。
它可能比这更复杂,但是为了简洁起见,我正在简化。
我的问题是:我如何为此提供一个自定义的绑定器/转换器,以覆盖SettingsClass中特定属性的配置绑定,以便在进行字符串转换时将“禁用”转换为-1,而不是抛出“禁用”不能转换为Int32?
将请求从www.mysite.com重定向到www.mysite.com/swagger的正确方法是什么?
我设置了一个索引控制器装饰路线(""),它的工作原理,但看起来像一个Kludge.我假设应该有一种方法在Startup.cs中的MVC路由中指定它,我只是想不出来.
// kludge code, how do I do this in app.UseMvc(route => route.MapRoute...
[ApiExplorerSettings(IgnoreApi = true)]
[Route("")]
public class IndexController : Controller
{
public ActionResult Index()
{
return Redirect("/swagger");
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 browserlink 来编辑 CSS 样式,效果非常好。不幸的是,如果我更改 .cshtml 文件中的某些内容,我的浏览器会在保存时自动刷新,但更改不可见。
如果我关闭应用程序并再次打开,更改就会可见。看起来我的应用程序正在某处缓存视图,而不是将我所做的更改重新加载到我的文件中。
这确实不是浏览器缓存问题。应用程序确实发送未更改的 html 结果。
如何在开发中禁用此类缓存功能?
我正在使用最新的 ASP NET Core MVC 库。
编辑:如果我更改 _layout 中的任何内容,网站就会更新,没有任何问题。
编辑2:启动功能
public void ConfigureServices(IServiceCollection services)
{
services.AddWebSocketManager();
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
var path = System.AppDomain.CurrentDomain.BaseDirectory;
var machineName = Environment.MachineName;
var confBuilder = new ConfigurationBuilder();
IConfigurationBuilder conf = confBuilder.SetBasePath(path);
if (env == "Development")
{
conf = conf.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: true);
conf = conf.AddJsonFile($"appsettings.Development.json", optional: true, reloadOnChange: true);
conf = conf.AddJsonFile($"appsettings.{machineName}.json", optional: true, reloadOnChange: true);
conf = conf.AddJsonFile($"appsettings.External.json", optional: true, …Run Code Online (Sandbox Code Playgroud) 我必须编写方法来生成随机用户名,其中包含8个字符,由小写字母和最多3个数字组成.所以我写了以下方法:
public string UsernameGenerator()
{
const string letters = "abcdefghijklmnopqrstuvwxyz";
const string digits = "0123456789";
var builder = new StringBuilder();
Random random = new Random((int)DateTime.Now.Ticks);
int numberOfNumerics = random.Next(0, 4);
for (int i = 0; i < 8; i++)
{
var l = letters[random.Next(0, letters.Length)];
builder.Append(l);
}
for (int i = 0; i < numberOfNumerics; i++)
{
int replaceIndex = random.Next(0, 8);
var d = digits[random.Next(0, digits.Length)];
builder.Replace(builder[replaceIndex],d);
}
return builder.ToString();
}
Run Code Online (Sandbox Code Playgroud)
但是,它会不时生成包含4位数的用户名.我的numberOfNumerics变量是random.Next(0,4),根据文档它应该从0到3返回随机数.看起来额外的数字是已经使用的数字之一的副本,并且它通常彼此相邻放置.错误生成密码的一些示例:
ko90w09q,qs2b22m6,yh38wa88,x66uvf36
是的,random.Next(0, 4);改为 …
我有一个ASP.Core RC2项目(使用.NET 4.5.1框架),应该作为x86 Web站点部署在Azure上.
在VS中的"发布设置"选项卡上,有以下值:
我想要改变的是x86平台的"目标运行时"的值,但这个组合框是无效的(灰色).
当前project.json:
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1-*",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net451": { }
},
"publishOptions": {
"include": [
"appsettings.json",
"project.json",
"web.config",
"NlogWeb.config"
]
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-*",
"imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
}
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用.net核心web api后端的iOS应用程序上实现Facebook登录.
获取返回状态代码401,就像我的令牌无效一样.我想知道iOS令牌是否也可以用于网页应用程序?我为我的Facebook应用程序配置了这两个.
我正在运行一个 ASP.NET Core 2.0 应用程序,该应用程序利用应用程序网关后面的 Azure 应用服务中托管的 ASP.NET Identity。
我设置了一个自定义域,通过 SSL 指向应用程序网关,然后终止 SSL 并将请求转发到我的后端池,该池使用超过 80 的默认 *.azurewebsites.net 域。
例如,请求 custom.com:443 ---> 应用程序网关 ---> custom.azurewebsites.net:80
我已使用以下中间件将 ASP.NET Core 2.0 应用程序配置为在 1 小时后将用户会话超时:
services.ConfigureApplicationCookie(options =>
{
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
});
Run Code Online (Sandbox Code Playgroud)
当用户超时然后执行另一个操作时,他们将被重定向到 custom.azurewebsites.net:80 上应用服务的登录页面,而不是通过应用程序网关返回。
有没有一种方法可以在超时时重定向到绝对 URL 而不是相对 URL?
asp.net-core ×7
c# ×3
azure ×2
jwt ×1
middleware ×1
random ×1
swagger ×1
swashbuckle ×1
xamarin ×1