小编Dar*_*g8r的帖子

解析简单日期时间

DateTime dt = DateTime.ParseExact("1122010", "Mddyyyy", System.Globalization.CultureInfo.CurrentCulture);
Run Code Online (Sandbox Code Playgroud)

抛出此异常:String未被识别为有效的DateTime.

我确信本月缺少领先0.什么是正确的格式字符串?

c# datetime parsing

9
推荐指数
1
解决办法
806
查看次数

Windows 10和Visual Studio 2015

我可以使用Visual Studio 2015预览在预览版上开始构建Windows 10应用程序吗?或者至少开始修补和测试?

windows-10 visual-studio-2015

9
推荐指数
1
解决办法
1万
查看次数

NetCore 2.1通用主机即服务

我正在尝试使用最新的Dotnet Core 2.1运行时构建Windows服务.我没有托管任何aspnet,我不想或不需要它来响应http请求.

我按照示例中的代码进行了操作:https: //github.com/aspnet/Docs/tree/master/aspnetcore/fundamentals/host/generic-host/samples/2.x/GenericHostSample

我也读过这篇文章:https: //docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-2.1

使用dotnet run在控制台窗口内运行时,代码运行良好.我需要它作为Windows服务运行.我知道有Microsoft.AspNetCore.Hosting.WindowsServices,但那是WebHost,而不是通用主机.我们使用host.RunAsService()作为服务运行,但我没有看到它存在于任何地方.

如何将其配置为作为服务运行?

using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace MyNamespace
{
    public class Program
    {


        public static async Task Main(string[] args)
        {
            try
            {
                var host = new HostBuilder()
                    .ConfigureHostConfiguration(configHost =>
                    {
                        configHost.SetBasePath(Directory.GetCurrentDirectory());
                        configHost.AddJsonFile("hostsettings.json", optional: true);
                        configHost.AddEnvironmentVariables(prefix: "ASPNETCORE_");
                        configHost.AddCommandLine(args);
                    })
                    .ConfigureAppConfiguration((hostContext, configApp) =>
                    {
                        configApp.AddJsonFile("appsettings.json", optional: true);
                        configApp.AddJsonFile(
                            $"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json",
                            optional: true);
                        configApp.AddEnvironmentVariables(prefix: "ASPNETCORE_");
                        configApp.AddCommandLine(args);
                    })
                    .ConfigureServices((hostContext, services) => …
Run Code Online (Sandbox Code Playgroud)

c# .net-core

9
推荐指数
1
解决办法
5689
查看次数

在2012年附加到流程

我们曾经在VS 2010中附加了一个处理宏.这非常方便.既然Visual Studio 2012中的宏已经消失了,是否存在可以为我们执行此操作的插件?我们的宏将附加到w3.exe进程,它很漂亮!

也许我需要将我们的宏转换为插件?

visual-studio-2012

7
推荐指数
1
解决办法
2388
查看次数

子节点"2"过早退出

我最近将Windows 8.1应用程序重新定位到Windows 10.我在构建UI项目时遇到此错误,

"MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt."
Run Code Online (Sandbox Code Playgroud)

这不是特别有用,所以我去%temp%寻找所说的故障日志,它不存在.我在寻找错误的"临时"目录吗?

是什么导致这个错误?我可以构建我的支持库项目而不会出现此错误.

msbuild visual-studio-2015 windows-10-universal

7
推荐指数
2
解决办法
8354
查看次数

博客区域位置

我的布局文件中有以下区域:

@Display(Model.Blog)
Run Code Online (Sandbox Code Playgroud)

我想总是将我的博客帖子列表呈现到这个区域,所以我编辑了我的placement.info文件,如下所示:

<Place Parts_Blogs_BlogPost_List="Blog"/>
Run Code Online (Sandbox Code Playgroud)

Parts.Blogs.BlogPost.List.cshtml位于我主题的Views目录中.

我无法让博客呈现.如果将区域名称更改为"内容",则可以使用....

更新

在我的主题目录的根目录中的placement.info中:

            <Place Parts_Blogs_BlogPost_List="/BlogZone"/>
Run Code Online (Sandbox Code Playgroud)

在我的layout.cshtml中

@if (Model.Content != null) {
<div id="content">
    <div class="container"> 
        @Display(Model.Content)
    </div>
</div>
}

@if (Model.BlogZone != null)
{

<div id="content">blog zone
    <div class="container">
        <div class="row-fluid">
            <h2 class="title-divider"><span>Company <span class="de-em">Blog</span></span> <small>We love to talk!</small></h2>
        </div>
        <div class="row"> 
            <!--Blog Roll Content-->
            <div class="span9 blog-roll blog-list">
                @Display(Model.BlogZone) 
            </div>
        </div>
    </div>
</div>
}
Run Code Online (Sandbox Code Playgroud)

"Parts_Blogs_BlogPost_List"部分仍然在"内容"区域内呈现.

orchardcms

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

角度服务承诺

所以,我有一个Angular应用程序可以对服务器进行调用.有一个服务包装了对服务器的调用.我目前在服务上有一个方法,它只是从$ http服务返回promise.我想在该方法调用上添加一些额外的处理,但由于promise的异步性质,我不知道该怎么做.

目前在打字稿中:

class BoardService {
    private $http;

    constructor($rootScope: IRootScope, $http: ng.IHttpService) {
          this.$http = $http;
    }

    fetchBoard(id: number) {
        return this.$http.get("/api/board/" + id);
    }
}
Run Code Online (Sandbox Code Playgroud)

我想得到这样的东西:

fetchBoard2(id: number) {
    this.$http.get("/api/board/" + id).success(function(data)
    {
        // Manipulate the data

    });

    // return manipulated data; 
}
Run Code Online (Sandbox Code Playgroud)

你会怎么做?

javascript angularjs typescript

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

RouterLink数组

我有一个超链接,我需要在Angular 4中建立一个路由器链接.我有很多部分到url,其中一部分是一个数组.我不确定如何将数组拆分为routerlink数组的部分.

拿这个人为的例子:

[routerLink]="['/customers', customerid, orderid, arrayofints, anotherint]"
Run Code Online (Sandbox Code Playgroud)

我希望路由器看起来像customerid = 10,order = 500,arrayofints = [1,2,3],anotherint = 888

"/customers/10/500/1/2/3/888"
Run Code Online (Sandbox Code Playgroud)

我最终得到了类似的东西:

"/customers/10/500;0=1;1=2;2=3/888"
Run Code Online (Sandbox Code Playgroud)

routerlink angular

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

Angular + web3.js:找不到模块:错误:无法解析“加密”

我正在尝试开始使用 Angular 和 Web3.js 来处理一些以太坊合约。重现:

  1. 新的
  2. npm install web3 --save
  3. 服务

包.json:

{
  "name": "ng-eth",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~11.0.6",
    "@angular/common": "~11.0.6",
    "@angular/compiler": "~11.0.6",
    "@angular/core": "~11.0.6",
    "@angular/forms": "~11.0.6",
    "@angular/platform-browser": "~11.0.6",
    "@angular/platform-browser-dynamic": "~11.0.6",
    "@angular/router": "~11.0.6",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "web3": "^1.3.4",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1100.6",
    "@angular/cli": "~11.0.6",
    "@angular/compiler-cli": "~11.0.6",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0", …
Run Code Online (Sandbox Code Playgroud)

angular web3js web3-donotuse

6
推荐指数
2
解决办法
2489
查看次数

在monotouch中构建静态库

是否可以使用可由Xcode开发人员使用的MonoTouch构建静态库?标题怎么样?

我来自C#背景,我有一个大型库可以移植到iOS.

如果我可以将它保存在C#中并根据需要进行调整,它可以节省大量时间.

objective-c xamarin.ios

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