我正在研究MVC 6应用程序(DNX Core 5.0框架).不幸的是,我找不到任何pdf导出库.
任何帮助将不胜感激.
我正在浏览Shawn Wildermuth的课程,并在构建时收到有关web.config的以下警告
Severity Code Description Project File
Line
Warning The element 'system.webServer' has invalid child element 'httpPlatform'.
List of possible elements expected: 'asp, caching, cgi, defaultDocument,
directoryBrowse, globalModules, handlers, httpCompression, webSocket,
httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing,
isapiFilters, modules, applicationInitialization, odbcLogging, security,
serverRuntime, serverSideInclude, staticContent, tracing, urlCompression,
validation, management, rewrite'.
TheWorld E:\EShared\Pluralsight\aspdotnet-5-ef7-bootstrap-angular-web-app\1-aspdotnet-5-ef7-bootstrap-angular-web-app-m1-exercise-files\VS2015\src\TheWorld\wwwroot\web.config 8
Run Code Online (Sandbox Code Playgroud)
Web.config是
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
程序运行正常.我应该对警告做些什么吗?
我有一个Asp.net 5 Web应用程序,在开发中运行良好(从Visual Studio或VS代码我可以启动没问题).然而,在成功发布应用程序,试图与启动网站时,"web.cmd"出现以下错误,并防止网站从不断加载:
Application startup exception: System.IO.FileNotFoundException: Could not load file or assembly 'my-ng2-website' or one of its dependencies. The system cannot find the file specified.
File name: 'my-ng2-website' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath)
at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory)
at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs …Run Code Online (Sandbox Code Playgroud)这分解为一些微不足道的子问题
我很困惑,因为我开始在.NET核心站点,跟随链接到ASP.NET 5 RC,一直提到Mono.
创建 WebSocketManagerExtensions 时出现错误,如下所示:
System.InvalidOperationException
A suitable constructor for type
'CustomerManagementCore.WebSocketManager.WebSocketManagerMiddleware' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
Run Code Online (Sandbox Code Playgroud)
MapWebSocketManager 方法:
public static IApplicationBuilder MapWebSocketManager(this IApplicationBuilder app,
PathString path,
WebSocketHandler handler)
{
return app.Map(path, (_app) => _app.UseMiddleware<WebSocketManagerMiddleware>(handler));
}
Run Code Online (Sandbox Code Playgroud)
WebSocketManagerMiddleware 构造函数:
public WebSocketManagerMiddleware(RequestDelegate next,
WebSocketHandler webSocketHandler)
{
_next = next;
_webSocketHandler = webSocketHandler;
}
Run Code Online (Sandbox Code Playgroud)
我知道我的WebSocketManagerMiddleware构造函数是否有问题,但我不知道。有人知道吗?
谢谢。