services

Visual Studio Code can't resolve angular's tsconfig paths

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to import some services using barrels and tsconfigs paths options but I can't get angular and vscode to get along. If it works for one it doesn't for the other and viceversa... My situation seems to be pretty simple: in src/app/services I have a service which is exported in a index.ts my src/tsconfig.app.json is just this: { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "types": [], "baseUrl": ".", "paths": { "services": ["app/services"] } }, "exclude": [ "test.ts", "**/*.spec.ts" ], } and my

Asp.Net Core 2.1 Windows Auth. HttpContext.User.Identity.Name not working in IIS

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Environment: Windows 10 IIS 10 / Visual Studio 2017 Community w/ IIS Express Windows Authentication security feature installed Windows Authentication Enabled & Basic Authentication Enabled & Anonymous Authentication Disabled I have a Asp.Net Core 2.1 Project and this project will work in intranet. So i need to windows authentication. STARTUP: public class Startup { private IConfigurationRoot _appSettings; public Startup(IHostingEnvironment env, IConfiguration configuration) { Configuration = configuration; _appSettings = new

.NET Core 2.2 CORS Not Allowing Requests

匿名 (未验证) 提交于 2019-12-03 01:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have checked several other threads on this and still can't manage to figure this out. I'm wanting to allow any origin, header, method, etc. to access my .NET Core 2.2 API. public void ConfigureServices(IServiceCollection services) { services.AddCors(); services.AddMvc(); ... public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime, IDistributedCache cache) { app.UseCors(builder => builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); I made sure the CORS methods were

.Net Core3.0依赖注入DI

为君一笑 提交于 2019-12-03 01:33:41
构建ASP.NET Core应用程序的时候,依赖注入已成为了.NET Core的核心,这篇文章,我们理一理依赖注入的使用方法。 不使用依赖注入 首先,我们创建一个ASP.NET Core Mvc项目,定义个表达的爱服务接口,中国小伙类实现这个类如下: public interface ISayLoveService { string SayLove(); } public class CNBoyService : ISayLoveService { public string SayLove() { return "安红,我喜欢你"; } } 在LoveController 控制器中调用 ISayLoveService的SayLove方法。 public class LoveController : Controller { private ISayLoveService loveService; public IActionResult Index() { loveService = new CNBoyService(); //中国小伙对安红的表达 ViewData["SayLove"] = loveService.SayLove(); return View(); } } 输出如图: 小结

HTML anchor tags not working in Firefox, Safari, iPad and iPhone

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My html anchor tags work in chrome and IE but in Firefox, Safari, iPad and iPhone they do not work, how come? and what can I do to fix it? <a href = "/services#underpinning" > Underpinning </a> Any help would be appreciated. Thanks. This is what I am trying to link it to on the services page: <h1 id = "#underpinning" name = "underpinning" > Underpinning </h1> This is where I left off: This is my link: <li><a href="/services#underpinning"><h2 id="underpinning">Underpinning<a href="services#underpinning"><img class="alignnone size

A required meta-data tag in your app's AndroidManifest.xml does not exist.

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am developing a google maps app for android. But, somehow my application crashes giving an error like : java . lang . IllegalStateException : A required meta - data tag in your app 's AndroidManifest.xml does not exist. This is what my AndroidManifest.xml looks like:- Log:- 01 - 09 12 : 29 : 35.249 : E / AndroidRuntime ( 7448 ): Caused by : java . lang . IllegalStateException : A required meta - data tag in your app 's AndroidManifest.xml does not exist. You must have the following declaration within the element: I am using

ASP.NET API: No database provider has been configured for this DbContext

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to connect to a MySql database from my .Net Core API project. This is my context class: public class MyContext : DbContext { public MyContext() { } public MyContext(DbContextOptions<MyContext> options) : base(options) { } public MyContext(DbContextOptions options) : base(options) { } ... } and this is my startup.cs : public void ConfigureServices(IServiceCollection services) { services.AddMvc(); string MyConnectionString = "server=localhost;port=3306;user=root;password=*****;database=my_db"; services.AddDbContext<MyContext>

Castle Windsor Ms Adaptor Core 2.0 Implementation

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Could someone expand upon the directions Halil Kalkan (@hikalkan) provided here: https://github.com/volosoft/castle-windsor-ms-adapter ORIGINAL - works using standard Microsoft DI public void ConfigureServices(IServiceCollection services) { services.AddAutoMapper(); services.AddMvc(); services.AddApiVersioning(); services.AddDbContextPool<CIDMSContext>(options => options.UseSqlServer("")); services.AddScoped<IBuildingRepository, BuildingRepository>(); services.AddScoped<IComponentRepository, ComponentRepository>(); } NEW - does not work.

WebService登陆验证四种方式

匿名 (未验证) 提交于 2019-12-03 00:39:02
在这个WEB API横行的时代,讲WEB Service技术却实显得有些过时了,过时的技术并不代表无用武之地,有些地方也还是可以继续用他的,我之所以会讲解WEB Service,源于我最近面试时被问到相关问题,我这里只是重新复习一下并总结一下,给新手们指指路,大牛们可以无视之,当然不足之处还请大家指教,谢谢! WEB Service身份验证,网上已有许多的相关文章,总结起来有: 基于自定义SoapHeader验证、Form验证、集成Windows身份验证、服务方法加入一个或几个验证参数 ;下面就不废话了,直接分享实现的代码吧,中间有涉及注意的地方,我会有说明文字的。 1.基于自定义SoapHeader验证 定义服务:(注意UserValidationSoapHeader必需有无参构造函数,否则无法序列化) //UserValidationSoapHeader: public class UserValidationSoapHeader : SoapHeader { public string UserName { get; set; } public string Password { get; set; } public UserValidationSoapHeader() { } public bool IsValid() { if (string.IsNullOrEmpty

.Net Core小技巧 - Hosted Services + Quartz实现定时任务调度

匿名 (未验证) 提交于 2019-12-03 00:39:02
背景   之前一直有朋友问,.Net Core + Linux环境有没有类似Windows服务的东西。其实是有的,我了解的方法有两种:   #1 创建一个ASP.Net Core的Web项目(如Web API),然后通过添加中间件(Middleware)的方式来启动任务;   #2 创建一个.Net Core的项目,添加Host,Dependency Injection,Configuration等组件,然后通过Main方法或中间件的方式启动服务。   但是,上述两种方法都有点不足,如:   #1 会把Web的生命周期引进来,但实际上,我们并不需要Web的功能,如Controller;   #2 本身是没有问题的,但是对开发者的要求相对高一点点,需要对.Net Core的各个组成部分都有一定的认识,简而言之,门槛有一丢丢高。   .Net Core 2.1推出了一个 Generic Host 的概念,可以很好的解决上面两种方法的不足:      至于为什么选择Quartz来做调度,我想可能是因为情怀吧,因为之前是用的TopShelf+Quartz,其实Hangfire也不错。 使用Hosted Service 1. 创建一个控制台程序。 2. 添加Host Nuget包。 Install-Package Microsoft.Extensions.Hosting -Version 2