无法在ASP.NET vNext中启动我的静态文件托管服务器 [英] Cannot start my static file hosting server in ASP.NET vNext

查看:60
本文介绍了无法在ASP.NET vNext中启动我的静态文件托管服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的ASP.NET vNext,只是想成为静态文件服务器.我曾使用 kvm upgrade 安装最新版本,而下面是我的 project.json .

I have an very simple ASP.NET vNext just wanted to be a static file server. I had used kvm upgrade to install the latest version and below is my project.json.


{
    "dependencies": {
        "Helios" : "0.1-alpha-*",
        "Microsoft.AspNet.FileSystems": "0.1-alpha-*",
        "Microsoft.AspNet.Http": "0.1-alpha-*",
        "Microsoft.AspNet.StaticFiles": ""
    },
    "commands": {
        "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:22222"
    },
    "configurations" : {
        "net45" : {
        },
        "k10" : {
            "System.Diagnostics.Contracts": "4.0.0.0",
            "System.Security.Claims" :  "0.1-alpha-*"
        }
    }
}

下面是我的 Startup.cs


using System;
using Microsoft.AspNet.Builder;

namespace WebApplication3
{
    public class Startup
    {
        public void Configure(IBuilder app)
        {
            app.UseStaticFiles();
        }
    }
}

然后,当我运行 kpm restore 时,我得到了错误提示

Then when I ran kpm restore I got the error said


Unable to locate Microsoft.AspNet.StaticFiles >= 0.1-alpha-build-0402
Unable to locate Microsoft.AspNet.Diagnostics >= 0.1-alpha-build-0623
Unable to locate Microsoft.AspNet.Hosting >= 0.1-alpha-build-0519
Unable to locate Microsoft.AspNet.Server.WebListener >= 0.1-alpha-build-0469

以下是 kvm列表的结果.


Active Version              Runtime Architecture Location
------ -------              ------- ------------ --------
       0.1-alpha-build-0421 svr50   x86          C:\Users\me\.kre\packages
       0.1-alpha-build-0472 svr50   x64          C:\Users\me\.kre\packages
       0.1-alpha-build-0472 svr50   x86          C:\Users\me\.kre\packages
  *    0.1-alpha-build-0496 svr50   x86          C:\Users\me\.kre\packages

我想我已经安装了 0.1-alpha-* ,但是为什么 kpm restore 告诉我找不到.

I think I have 0.1-alpha-* installed but why kpm restore told me cannot find.

推荐答案

您是否配置了AspNet vNext MyGet提要(github.com/aspnet/Home/blob/master/NuGet.Config#L4)?

Do you have the AspNet vNext MyGet feed (github.com/aspnet/Home/blob/master/NuGet.Config#L4) configured?

这篇关于无法在ASP.NET vNext中启动我的静态文件托管服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆