阅读这两个问题/答案,我能够在IIS 8.5服务器上运行Asp.net 5应用程序.
Asp.net vNext早期测试版在Windows服务器上发布到IIS
问题是,即使在IIS上运行,Web应用程序仍然使用env.EnvironmentName值Development.
另外,我想在同一台服务器上运行同一个Web(Staging,Production)的两个版本,所以我需要一个方法来分别为每个Web设置变量.
这该怎么做?
我刚刚将我的服务器(Windows 2012R2)更新.Net Core 1.0 RTM为之前的Windows Hosting包.Net Core 1.0 RC2.我的应用程序在我的电脑上运行没有任何问题,但服务器一直显示:
HTTP Error 502.5 - Process Failure
Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port
Run Code Online (Sandbox Code Playgroud)
它之前使用过RC2版本.不知道会出现什么问题.
这是所有事件查看器说:
Failed to start process with the commandline 'dotnet .\MyWebApp.dll'. Error code = '0x80004005'.
Run Code Online (Sandbox Code Playgroud)
最糟糕的是应用程序日志是空的!我的意思是那些stdout_xxxxxxxxx.log文件是完全空的,并且都有0字节大小.
我该怎么办??如果没有记录错误,我怎么知道错误原因?
我将.Net核心项目部署到Windows Server 2012 R2 64位,发生了这种情况:
HTTP错误502.5-根据Microsoft指南的处理失败,他们说这是由于平台与RID冲突。
(https://docs.microsoft.com/zh-cn/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors)
我已经完成了该指南中的所有步骤,但是无法解决。有人知道如何解决这个问题吗?如果可以的话,我将不胜感激。谢谢。
注意:我已经给了publish文件夹完全权限,并且还安装了ASPNetCoreModule v2.0,net core sdk 2.0。我的IIS版本是8.5。
这是我的.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RootNamespace>_MyAppAPI</RootNamespace>
<AssemblyName>_MyAppAPI</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Content Remove="wwwroot\swagger\authen\basic-auth.js" />
<Content Remove="wwwroot\swagger\ui\custome.css" />
</ItemGroup>
<ItemGroup>
<Folder Include="Middleware\" />
<Folder Include="Logs\" />
<Folder Include="Models\appapi\" />
<Folder Include="wwwroot\lib\" />
<Folder Include="wwwroot\logs\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference …Run Code Online (Sandbox Code Playgroud) 我在尝试运行 ASP.Net Core 3.1 项目时遇到错误。该错误是在CreateHostBuilder中Program.cs
public class Program {
public static void Main(string[] args) {
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
}
Run Code Online (Sandbox Code Playgroud)
尚未从 Visual Studio 2019 的默认 ASP.NET Core Web 应用程序模板编辑。它给出了例外
System.FormatException: '无法解析 JSON 文件。'
然而,它并没有准确地指代它无法解析的 JSON 文件。这是一个包含所有 3 个可以解析的现有 JSON 文件的pastebin。
这是完整的错误堆栈:
HResult=0x80131537
Message=Could not parse the JSON file.
Source=Microsoft.Extensions.Configuration.Json
StackTrace:
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at …Run Code Online (Sandbox Code Playgroud)