小编Ami*_*imi的帖子

免费在线Team Foundation Server

任何人都可以推荐一个好的免费在线Team Foundation Server存储库吗?

我找到了CodePlex,但它只适用于开源项目.

tfs tfsbuild azure-devops

49
推荐指数
5
解决办法
11万
查看次数

仿真器频繁断开,Android Studio Stuck.如何解决?

我有一个奇怪的问题,找不到任何解决方法.当我打开模拟器并且AVD正常运行时,第一次就可以了.但是5-10分钟后,模拟器断开连接,它失去了它的互联网连接,我无法连接到它,Android Studio也完全陷入困境,没有任何反应!我应该关闭模拟器,然后一切都恢复正常.

这些是我测试的:

adb kill-server 然后 adb start-server

我也尝试过再次连接和断开连接

adb connect localhost:5554而且adb connect emualtor-5554,但还是没有结果.

更糟糕的是我不能再使用Android Studio,即使点击代码行也行不通!

每次我应该关闭模拟器并再次打开它.

注意:我不能使用Genymotion,我不想使用我的设备进行调试!

任何身体都能解决这个该死的虫子.它让我发疯了...先谢谢

编辑:

问题不是与模拟器有关的问题.今天我尝试使用WiFi连接进行调试.一切都很好,直到我的真实设备再次出现问题.在日志中它说:

deviceXXXXX已断开连接

所以问题在于我的ADB连接!

我测试的是向防火墙添加端口5555还添加了ADB以通过防火墙.但问题仍然存在.

android android-emulator android-studio

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

ASP.NET Core多角度应用程序

我有一个ASP.NET Core 2.1,我需要为多个Angular应用程序设置工作区,并具有以下路由:

http://someurl.com/main - >第一个应用程序
http://someurl.com/admin - >第二个应用程序

我使用angular-cli.json以下设置:

"apps": [
{
  "root": "src",
  "outDir": "dist",
  "assets": [
    "assets"
  ],
  "index": "index.html",
  "main": "main.ts",
  "polyfills": "polyfills.ts",
  "test": "test.ts",
  "tsconfig": "tsconfig.app.json",
  "testTsconfig": "tsconfig.spec.json",
  "prefix": "app",
  "styles": [
    "styles.css",
    "../node_modules/bootstrap/dist/css/bootstrap.min.css"
  ],
  "scripts": [],
  "environmentSource": "environments/environment.ts",
  "environments": {
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
  }
},
{
  "root": "src2",
  "outDir": "dist2",
  "assets": [
    "assets"
  ],
  "index": "index.html",
  "main": "main.ts",
  "polyfills": "polyfills.ts",
  "test": "test.ts",
  "tsconfig": "tsconfig.app.json",
  "testTsconfig": "tsconfig.spec.json",
  "prefix": "app",
  "styles": [
    "styles.css", …
Run Code Online (Sandbox Code Playgroud)

asp.net-core angular-cli angular

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

一个主要尝试catch方法调用没有实现try-catch的方法

我有一个方法doSomething()有一个try catch块,我在其中调用另一个方法.

    public void doSomething()  
    {  
       try
        {
            doSomethingElse();
        }
        catch
        {
            // catch implementation goes here
        }

    } 
Run Code Online (Sandbox Code Playgroud)

在那个其他方法doSomethingElse()我没有任何尝试catch块.我依靠main方法的try-catch来处理异常.如果有任何例外,doSomethingElse()它们将被冒泡到方法doSomething的try-catch块.

这种方法有什么问题吗?

谢谢你的时间.

c# exception-handling exception

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

Tensorflow元组具有不同的形状

我有一个问题,返回一个两个变量的元组v,wt其中vhas shape=(20,20)wthas shape=(1,).wt是一个重量值的变量.我想在一个内部返回元组(v,wt)map_fn

我的代码看起来有点接近这个

tf.map_fn(fn, nonzeros(Matrix, dim, row))

nonzeros(Matrix, dim, row) returns a (index, value)
Run Code Online (Sandbox Code Playgroud)

fn会返回一个元组,但错误输出我得到的是:

ValueError: The two structures don't have the same number of elements. First 
structure: <dtype: 'int64'>, second structure: (<tf.Tensor 
'map_2/while/while/Exit_1:0' shape=(20,) dtype=float32>, <tf.Tensor 
'map_2/while/Sub:0' shape=() dtype=int64>).
Run Code Online (Sandbox Code Playgroud)

python factorization tensorflow

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

HttpContext不包含SignOutAsync的定义

我正在尝试编写一个自定义身份验证管理器,该程序将处理我的ASP .Net Core 2.x应用程序中的用户登录和注销以及许多其他内容,但我始终处于困境。

我尝试了这篇Microsoft文章中建议的方式,但是当我尝试实现登录时,它显示了HttpContext does not contain a definition for SignOutAsync错误。我有文章中建议的所有参考资料:

public async void SignIn(HttpContext httpContext, UserDbModel user, bool isPersistent = false)
        {
            ClaimsIdentity identity = new ClaimsIdentity(this.GetUserClaims(user), CookieAuthenticationDefaults.AuthenticationScheme);
            ClaimsPrincipal principal = new ClaimsPrincipal(identity);
            await HttpContext.SignInAsync(IdentityConstants.ApplicationScheme);
        }
Run Code Online (Sandbox Code Playgroud)

下面的代码有效,但是已经过时了:

await HttpContext.Authentication.SignOutAsync(...)
Run Code Online (Sandbox Code Playgroud)

类中的引用:

using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authentication;
Run Code Online (Sandbox Code Playgroud)

这里缺少什么?也许这些扩展方法已在新版本中删除,如果是的话...我如何以正确的方式实现身份验证?

asp.net asp.net-core-mvc .net-core asp.net-core asp.net-core-2.0

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

使用 hang-fire 和 ASP.NET Core 发送每日摘要电子邮件

我需要向所有用户发送每日摘要电子邮件,但我不确定应该在哪里触发它。

我做了一个发送电子邮件的课程:

public class SummaryEmailBusiness
{
    private MyDbContext _db;
    private IEmailSender _emailSender;

    public SummaryEmailBusiness(MyDbContext db, IEmailSender emailSender)
    {
        _db = db;
        _emailSender = emailSender;
    }

    public void SendAllSummaries()
    {
        foreach(var user in _db.AspNetUsers)
        {
            //send user a summary
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

然后在ConfigureServices()我注册了服务和hangfire:

services.AddHangfire(config =>
    config.UseSqlServerStorage(Configuration.GetConnectionString("DefaultConnection")));

services.AddTransient<SummaryEmailBusiness>();
Run Code Online (Sandbox Code Playgroud)

并在Configure() 添加

app.UseHangfireDashboard();
app.UseHangfireServer();
Run Code Online (Sandbox Code Playgroud)

现在我被困住了。Hang-fire 文档说我需要做类似的事情:

RecurringJob.AddOrUpdate(() =>  SendAllSummaries() , Cron.Daily);
Run Code Online (Sandbox Code Playgroud)

我不确定如何执行此操作,以便通过注入的依赖服务启动该类。如何引用SendAllSummaries()实例化服务的方法?

什么是最好的方法来做到这一点?

c# hangfire asp.net-core

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

从 netcore 2 中的 Url 禁用/删除 '?ReturnUrl='

我试图找到一种方法来阻止我的 aspnetcore 应用程序将“?ReturnUrl=”添加到 URL。有谁知道怎么做,使用某种中间件。

我尝试像下面那样做,但没有任何效果:

public class RequestHandlerMiddleware
{
    private readonly RequestDelegate _next;

    public RequestHandlerMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task Invoke(HttpContext context)
    {
        if(context.Request.QueryString.HasValue && context.Request.QueryString.Value.Contains("?ReturnUrl="))
        {
            context.Request.QueryString = new QueryString(string.Empty);
        }
        await _next.Invoke(context);
    }
}

public static class RequestHandlerMiddlewareExtension
{
    public static IApplicationBuilder UseRequestHandlerMiddleware(this IApplicationBuilder builder)
    {
        return builder.UseMiddleware<RequestHandlerMiddleware>();
    }
}
Run Code Online (Sandbox Code Playgroud)

注册startup.cs

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        app.UseExceptionHandler("/error");
    }

    app.UseDefaultFiles();
    app.UseStaticFiles();

    app.UseAuthentication();
    app.UseRequestHandlerMiddleware();

    app.UseMvc(routes …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-core asp.net-core-2.0

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

错误:与项目中的依赖项"com.android.support:multidex"冲突

我用以下gradle文件创建了一个新的android项目:

android {
   ...
   dexOptions {
        javaMaxHeapSize "4g"
    }
   ...
}

dependencies {
   ...
    compile 'com.linkedin.dexmaker:dexmaker-mockito:2.16.0'
   ...
}
Run Code Online (Sandbox Code Playgroud)

但是当我构建我的应用程序时,我得到:

在项目':app'中与依赖'com.android.support:multidex'冲突.app(1.0.3)和测试app(1.0.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.

我该如何解决这个问题?

android android-gradle-plugin android-multidex

4
推荐指数
1
解决办法
3896
查看次数

客户端如何知道应将哪些Cookie发送到服务器

当我转到HTTPS 服务器时,可以在开发人员工具(或Fiddler)中看到由客户端发送到服务器的 请求cookie。但是,如果服务器未发送响应cookie,客户端如何知道应该发送哪个cookie。至少我在开发人员工具或Fiddler中看不到任何响应cookie。

cookies http response request

3
推荐指数
1
解决办法
926
查看次数

如何在 VS Code 集成模式下打开 Windows 终端

我已添加以下几行Terminal \xe2\x80\xba Integrated \xe2\x80\xba Profiles: Windows

\n
    "terminal.integrated.profiles.windows": {\n        "WTP": {\n          "path": "C:\\\\Users\\\\***\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps\\\\wt.exe",\n        }\n    },\n    "terminal.integrated.defaultProfile.windows": "WTP",\n
Run Code Online (Sandbox Code Playgroud)\n

但这会将 Windows 终端打开为外部窗口

\n

我想以集成模式打开此终端,将其放入 VS Code 窗口中

\n

visual-studio-code windows-terminal

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