小编Gab*_*ert的帖子

带协议的Url.Action返回没有域的链接

我正在使用Url.Action生成一个绝对URL以通过电子邮件发送.链接在控制器内生成.

ConfirmLink = Url.Action(
    "ConfirmEmail",
    "Account",
    new { userId = user.Id, code },
    HttpContext.Request.Scheme
)
Run Code Online (Sandbox Code Playgroud)

出于某种原因,在本地,我有这样的结果:

http://localhost:5102/account/confirm-email?userId=10&code=CfDJ8JH5BJKUsPZDnCLwFc3HSEHfe9Fk00NHiJqk36VbvkDbbV39AI7HY5m9pXVItwYE9%2B9ElTcnBSZiDNQ%2FmO5lx1tSnuvDmhzdzGlCQCfPQVe%2B21Nw03uNuBWoO8HCVivqzfudti579bWiaLW6PuuQQimn449YymVjgV3R36HeQID26jTmAxizDTqOsF1%2FvQc5Zw%3D%3D
Run Code Online (Sandbox Code Playgroud)

但我在staging/prod中没有域/ https协议的结果:

http:///account/confirm-email?userId=10&code=CfDJ8JH5BJKUsPZDnCLwFc3HSEHfe9Fk00NHiJqk36VbvkDbbV39AI7HY5m9pXVItwYE9%2B9ElTcnBSZiDNQ%2FmO5lx1tSnuvDmhzdzGlCQCfPQVe%2B21Nw03uNuBWoO8HCVivqzfudti579bWiaLW6PuuQQimn449YymVjgV3R36HeQID26jTmAxizDTqOsF1%2FvQc5Zw%3D%3D
Run Code Online (Sandbox Code Playgroud)

我正在使用ASP .NET Core "Microsoft.AspNetCore.Mvc": "1.1.0".

应用程序发布到IIS.

c# sendgrid asp.net-core-mvc asp.net-core

8
推荐指数
1
解决办法
1284
查看次数

使用Kentor.AuthServices.StubIdp作为生产IDP

我正在尝试在我的应用程序中实现IDP(SAML2)服务器.鉴于我的应用程序具有所需的所有数据,我不希望我的任何合作伙伴要求我们的客户注册他们.

我对SAML2协议不是很熟悉.我发现项目Kentor.AuthServices.StubIdp是最有趣的,因为它实现了我需要的一切.我也知道它不是为生产目的而建的.

我打算在StubIdp之上构建IDP,因为我买不起像ComponentPro这样昂贵的解决方案.

有更好的选择吗?建立在StubIdp之上是一个好主意吗?

c# asp.net saml-2.0 asp.net-web-api kentor-authservices

6
推荐指数
1
解决办法
898
查看次数

找不到模块:错误:无法解析'./lib/axios'

我正在尝试在我的项目中导入axios.然而,由于某些原因,webpack/axios在尝试构建时给我带来了很大的麻烦.

GroupService.ts

import axios, { AxiosResponse, AxiosInstance } from 'axios';
Run Code Online (Sandbox Code Playgroud)

webpack --display-error-details错误

ERROR in ./~/axios/index.js
Module not found: Error: Can't resolve './lib/axios' in 'C:\dev\test-project\node_modules\axios'
resolve './lib/axios' in 'C:\dev\test-project\node_modules\axios'
  using description file: C:\dev\test-project\node_modules\axios\package.json (relative path: .)
  after using description file: C:\dev\test-project\node_modules\axios\package.json (relative path: .)
    using description file: C:\dev\test-project\node_modules\axios\package.json (relative path: ./lib/axios)
      as directory
        C:\dev\test-project\node_modules\axios\lib\axios doesn't exist
      no extension
        C:\dev\test-project\node_modules\axios\lib\axios doesn't exist
      .ts
        C:\dev\test-project\node_modules\axios\lib\axios.ts doesn't exist
[C:\dev\test-project\node_modules\axios\lib\axios]
[C:\dev\test-project\node_modules\axios\lib\axios]
[C:\dev\test-project\node_modules\axios\lib\axios.ts]
 @ ./~/axios/index.js 1:17-39
 @ ./src/services/GroupService.ts
 @ ./src/test-project.ts
Run Code Online (Sandbox Code Playgroud)

这是我的webpack配置.

webpack.config.js

/** Plugin settings …
Run Code Online (Sandbox Code Playgroud)

typescript webpack axios

6
推荐指数
3
解决办法
9085
查看次数

Npgsql / EF 6 - json 列

我正在尝试使用 JSON 列创建迁移。这是我尝试过的:

    [Column(TypeName = "Jsonb")]
    public string Data { get; set; }

    [Column(TypeName = "Json")]
    public string Data { get; set; }

    modelBuilder.Entity<Member>().Property(p => p.Data).HasColumnType("Json");

    modelBuilder.Entity<Member>().Property(p => p.Data).HasColumnType("Jsonb");
Run Code Online (Sandbox Code Playgroud)

什么都不起作用,这是例外:

System.InvalidOperationException: Sequence 在 System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 谓词) at System.Data.Entity.Utilities.DbProviderManifestExtensions.GetStoreTypeFromName(DbProviderManifest providerManifest, String name) at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.ConfigureColumn(EdmProperty column, EntityType table, DbestProviderManifest providerManifest在 System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(EdmProperty 列,EntityType 表,DbProviderManifest providerManifest,Boolean allowOverride,Boolean fillFromExistingConfiguration)在 System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration .<>c__DisplayClass4.b__3(Tuple 2 pm) at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable1 ts, Action1 action) at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(IEnumerable1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration) at System.Data.Entity.ModelConfiguration.Configuration.Types.StructuralTypeConfiguration.ConfigurePropertyMappings(IList …

c# asp.net-mvc entity-framework npgsql entity-framework-migrations

5
推荐指数
1
解决办法
1423
查看次数

使用AppVeyor部署.NET Core应用程序:由外部进程锁定的文件(Appveyor代理)

我正在尝试使用Appveyor代理在服务器上部署项目.但是,如果我在部署之前没有重新启动或停止应用程序,则它不起作用.

Web Deploy cannot modify the file 'TestProject.Application.dll' on the destination because it is locked by an external process.  In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Run Code Online (Sandbox Code Playgroud)

有没有一种简单的方法来处理app_offline.htm文件?使用"app_offline"功能的appveyor.yml配置在这种环境中不起作用.

我在"之前/之后"部分寻找一些东西.这是我的appveyor.yml:

version: '1.0.{build}'
os: Visual Studio 2015

install:
- "SET PATH=C:\\Program Files\\dotnet\\bin;%PATH%"

branches:
  only:
  - master

assembly_info:
  patch: true
  file: '**\AssemblyInfo.*' …
Run Code Online (Sandbox Code Playgroud)

deployment app-offline.htm appveyor

5
推荐指数
1
解决办法
658
查看次数

将IdentityServer4映射到“ / identity”,然后映射UI

我的应用程序基本上就是这个应用程序:https : //github.com/IdentityServer/IdentityServer4.Quickstart.UI

但是我正在尝试使用以下代码将其映射到“ / identity”:

app.Map("/identity", builder => { builder.UseIdentityServer(); });
Run Code Online (Sandbox Code Playgroud)

运行良好,我可以/identity/.well-known/openid-configuration成功访问。

但是,如果我尝试连接,则应用程序会将我重定向到/identity/account/loginIdentityServer一侧的。IdentityServer找不到我的控制器,因此返回404。

我尝试了LoginUrl属性:

services.AddIdentityServer(options =>
{
    options.UserInteraction.LoginUrl = "/bleh/account/login";
})
Run Code Online (Sandbox Code Playgroud)

但它也会返回404。

我还尝试使Quickstart控制器路由与重定向路由相同:

[Route("identity/account/login")]
Run Code Online (Sandbox Code Playgroud)

但它也会返回404。

任何的想法?

asp.net-core-mvc identityserver4

5
推荐指数
1
解决办法
932
查看次数

检查多个存储库中是否需要推送/提交

我的计算机上有 140 个 git 存储库,每周可以处理其中 10-15 个。有没有办法知道是否忘记提交/推送我的一个项目?

这些存储库都位于同一位置:“C:/Projects”。

输出会是这样的

  1. C:/Projects/lib1 -> 需要提交和推送
  2. C:/Projects/lib6 -> 需要提交和推送
  3. C:/Projects/lib11 -> 需要提交和推送

谢谢你!

git

2
推荐指数
1
解决办法
209
查看次数

ImageProcessor/Windows Azure存储问题,返回403 Forbidden

这些图像可以加载到本地ENV中,也可以加载到生产环境中.但是,没有任何理由,登台环境无法加载这些.

<package id="ImageProcessor" version="2.2.0.0" targetFramework="net45" />
  <package id="ImageProcessor.Web" version="4.2.1.0" targetFramework="net45" />
  <package id="ImageProcessor.Web.Config" version="2.2.0.0" targetFramework="net45" />
  <package id="ImageProcessor.Web.Plugins.AzureBlobCache" version="1.0.0.0" targetFramework="net45" />
  <package id="ImageProcessor.Web.PostProcessor" version="1.0.2.0" targetFramework="net45" />
  <package id="UmbracoAzureBlobStorageProvider" version="1.0.10.5" targetFramework="net45" />
  <package id="WindowsAzure.Storage" version="4.3.0" targetFramework="net45" />
Run Code Online (Sandbox Code Playgroud)

我正在使用ImageProcessor,并根据需要将域列入白名单:

<whitelist>
        <add url="http://conceptjp.blob.core.windows.net/"/>
        <add url="https://az739977.vo.msecnd.net/"/>
</whitelist>
Run Code Online (Sandbox Code Playgroud)

https://staging.conceptjp.com/remote.axd?https://az739977.vo.msecnd.net/media/6883/logo-sparitual.png?quality=70(不起作用)

https://conceptjp.com/remote.axd?https://az739977.vo.msecnd.net/media/6883/logo-sparitual.png?quality=70(works)

https://cjp.local/remote.axd?https://az739977.vo.msecnd.net/media/6883/logo-sparitual.png?quality = 70(作品,当地环境)

2016-10-04 13:31:11.2393 Logging.TheLogger The remote server returned an error: (403) Forbidden. The remote server returned an error: (403) Forbidden.    at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
   at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass1`1.<CreateCallback>b__0(IAsyncResult ar)
--- End of stack …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc umbraco azure-storage imageprocessor

2
推荐指数
1
解决办法
727
查看次数