我们是否可以使用单声道在Mac上运行现有的ASP.NET 4.5 Web窗体应用程序:https: //code.msdn.microsoft.com/Getting-Started-with-221c01f5?cncid_id = 2013-12-16-001
我相信我需要使用Mono感知IDE并尝试重新引用所有兼容的.dll并尝试修改单声道版本中没有等效的代码以使用单声道库.
这是真的?
有一个开源问卷类型的应用程序(不同于上面的应用程序),我想在Mac上运行.我有一个Mac电脑的朋友想从驻留在Mac上的Web服务器提供网页服务谁(我不知道什么样的服务会是这样 - 像IIS的Mac版 - 某种守护程序服务)和时提交问卷回复他希望创建该回复的.PDF并保存在Mac本地文件夹中(所以我需要找到一种方法如何根据发布的响应数据使用create .pdf)
vnext版本没问题(我听说通过Web Forms应用程序改进了所有版本),但我不知道Web窗体库是否适用于Mac
我想在Windows机器上开发和调试,只需在Mac上部署和配置Web服务器.
适用于Windows的Xamarin Studio或适用于Windows的MonoDevelop是否可以解答?
什么是Mac上最好的Web服务器,可以提供与IIS性质相似的页面?
在我的MVC4应用程序中,我有一个global.asax.cs覆盖Application_Error(object sender, EventArgs e)我可以提取的地方exception,statusCode以及requestedUrl(用于处理404).这将被发送到我的控制器,错误页面将是不同的404s与5xx(这些获得堆栈跟踪).我没有看到如何使用相同的信息获取我的错误操作UseErrorHandler().我在ASP.NET Core中使用正确的方法吗?
以前在其他版本的asp.net中,我使用了以下属性HttpRequest:
Request.ServerVariables["REMOTE_ADDR"]
Request.UserHostAddress
Run Code Online (Sandbox Code Playgroud)
如何在ASP.NET Core中实现相同的功能?
ASP.NET Core文档说,其中一个先决条件是在目标服务器上安装.NET Core Windows Server Hosting软件包.
是否有可能以某种方式将此依赖项包含在由dotnet-publish创建的自包含包中,并避免现场安装?
我在VS 2017中创建了一个ASP.NET Core 2.0项目.当我发布我的项目时,Views文件夹不存在,但wwwroot文件夹是.
我可以在我的.csproj文件中设置以下内容:
<ItemGroup>
<Content Update="appsettings.json;web.config" CopyToOutputDirectory="PreserveNewest"/>
<Content Update="Views\**\*" CopyToOutputDirectory="PreserveNewest" />
<Content Update="wwwroot\**\*" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Run Code Online (Sandbox Code Playgroud)
但没有奏效.
asp.net-core-mvc asp.net-core visual-studio-2017 asp.net-core-2.0
AppHarbor是否支持ASP.NET Core?
当我尝试部署我的示例应用程序时(从Visual Studio 2015 RC模板),我在AppHarbor中获得了以下构建日志:
Build started 5/4/2015 2:28:38 PM.
1>Project "D:\temp\g3zdb4oh.rcv\input\ASPNetTest.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>Project "D:\temp\g3zdb4oh.rcv\input\ASPNetTest.sln" (1) is building "D:\temp\g3zdb4oh.rcv\input\src\ASPNetTest\ASPNetTest.xproj" (2) on node 1 (default targets).
2>D:\temp\g3zdb4oh.rcv\input\src\ASPNetTest\ASPNetTest.xproj(7,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\DNX\Microsoft.DNX.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
2>Done Building Project "D:\temp\g3zdb4oh.rcv\input\src\ASPNetTest\ASPNetTest.xproj" (default targets) -- FAILED.
1>Done Building Project "D:\temp\g3zdb4oh.rcv\input\ASPNetTest.sln" (default targets) -- …Run Code Online (Sandbox Code Playgroud) 我不想Id在我的上绑定属性CustomerViewModel所以我添加了一个[BindNever]属性,但它不起作用.可能是什么解决方案?
我有以下内容:
CustomerController.cs
// PUT api/customers/5
[HttpPut("{id}")]
public async Task<IActionResult> Put([FromUri] int id, [FromBody]CustomerViewModel customer)
{
//Implementation
}
Run Code Online (Sandbox Code Playgroud)
CustomerViewModel
public class CustomerViewModel
{
[BindNever]
public int Id { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public string Email { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
如果我输入以下json.该id物业仍然被绑定
{
"id": 100,
"lastName": "Bruce",
"firstName": "Wayne",
"email": "bruce@gothamcity.com"
}
Run Code Online (Sandbox Code Playgroud) 最近我配置了Serilog以与ASP.NET Core 2 MVC应用程序配合使用,接下来的任务是在系统的每一层上跟踪传入的Web应用程序请求.所以基本上,我们想要传播一些令牌(比如RequestId由Serilog生成到较低层的应用程序).
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.RollingFile" ],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning"
}
},
"WriteTo": [
{
"Name": "RollingFile",
"Args": {
"pathFormat": "log-{Hour}.txt",
"fileSizeLimitBytes": "",
"retainedFileCountLimit": "",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Application}] [{Level}] [{RequestId}] - {Message}{NewLine}{Exception}"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"Properties": {
"Application": "MultilayerApp"
}
},
Run Code Online (Sandbox Code Playgroud)
在日志中,我们有很好的输入
2018-01-19 14:06:01.165 +00:00 [App] [Warning] [0HLAV6PIMA9M0:00000001] - Accessing expired session, Key:"6e7f3ab5-db62-335d-1bc7-6824e5b918f5"
Run Code Online (Sandbox Code Playgroud)
但我的问题是Serilog在哪里实现更丰富RequestId?老实说,我找不到它.
我有一个ASP.NET Core 2.0应用程序,并且Angular 5 SPA托管在同一文件夹中。
当前要部署到IIS,我需要执行以下操作:
// First publish the release configuration
dotnet publish -c release
// Now delete the wwwroot directory as it is pulished with ng build
rm -r bin/release/netcoreapp2.0/publish/wwwroot
// Build the prod version of the angular app
ng build --prod
// copy the new wwwroot folder into the publish folder
cp -R wwwroot bin/release/netcoreapp2.0/publish/
Run Code Online (Sandbox Code Playgroud)
这非常令人困扰...我如何告诉dotnet publish运行ng build --prod?
我尝试将以下内容添加到我的项目csproj文件中:
<Target Name="AngularBuild" AfterTargets="Publish">
<Exec Command="npm run build --prod" />
</Target>
Run Code Online (Sandbox Code Playgroud) 如何使用dotnet cli指定使用特定配置运行我的Web应用程序.我知道hosting.json可以使用,但我没有找到任何文档如何做到这一点以及这与dotnet cli有什么关系.
asp.net-core ×10
dotnet-cli ×2
angular ×1
appharbor ×1
c# ×1
deployment ×1
iis ×1
ip-address ×1
logging ×1
macos ×1
mono ×1
serilog ×1
webforms ×1