草庐IT

core-default

全部标签

怎么启动.net core 项目

要启动.NETCore项目,你需要先确保你的电脑上已经安装了.NETCore运行时。如果你还没有安装,请前往https://dotnet.microsoft.com/download下载并安装。然后,你可以使用以下方法来启动你的.NETCore项目:在命令行中进入你的项目文件夹,然后输入以下命令:dotnetrun在VisualStudio中打开你的项目,然后点击“运行”按钮。在VisualStudioCode中打开你的项目,然后按下F5键。注意,你需要在项目文件夹中打开命令行或使用VisualStudio或VisualStudioCode来启动项目。如果你在启动项目时遇到问题,请检查你的项目

c# - IIS 错误 502.5 上的 ASP.NET Core 1.0

我刚刚将我的服务器(Windows2012R2)从以前的.NetCore1.0RC2更新到.NetCore1.0RTMWindows主机包。我的应用程序在我的PC上运行没有任何问题,但服务器一直显示:HTTPError502.5-ProcessFailureCommoncausesofthisissue:TheapplicationprocessfailedtostartTheapplicationprocessstartedbutthenstoppedTheapplicationprocessstartedbutfailedtolistenontheconfiguredport它以前

c# - IIS 错误 502.5 上的 ASP.NET Core 1.0

我刚刚将我的服务器(Windows2012R2)从以前的.NetCore1.0RC2更新到.NetCore1.0RTMWindows主机包。我的应用程序在我的PC上运行没有任何问题,但服务器一直显示:HTTPError502.5-ProcessFailureCommoncausesofthisissue:TheapplicationprocessfailedtostartTheapplicationprocessstartedbutthenstoppedTheapplicationprocessstartedbutfailedtolistenontheconfiguredport它以前

c# - ASP.NET Core 使用 IConfiguration 获取 Json 数组

在appsettings.json中{"MyArray":["str1","str2","str3"]}在Startup.cs中publicvoidConfigureServices(IServiceCollectionservices){services.AddSingleton(Configuration);}在家庭Controller中publicclassHomeController:Controller{privatereadonlyIConfiguration_config;publicHomeController(IConfigurationconfig){this._c

c# - ASP.NET Core 使用 IConfiguration 获取 Json 数组

在appsettings.json中{"MyArray":["str1","str2","str3"]}在Startup.cs中publicvoidConfigureServices(IServiceCollectionservices){services.AddSingleton(Configuration);}在家庭Controller中publicclassHomeController:Controller{privatereadonlyIConfiguration_config;publicHomeController(IConfigurationconfig){this._c

c# - ASP.NET Core 表单 POST 导致 HTTP 415 Unsupported Media Type 响应

将表单POSTHTTP请求(Content-Type:application/x-www-form-urlencoded)发送到下面的Controller会导致HTTP415UnsupportedMediaType响应。publicclassMyController:Controller{[HttpPost]publicasyncTaskSubmit([FromBody]MyModelmodel){//...}}表单发布HTTPheader:POST/submitHTTP/1.1Host:example.com:1337Connection:keep-aliveContent-Leng

c# - ASP.NET Core 表单 POST 导致 HTTP 415 Unsupported Media Type 响应

将表单POSTHTTP请求(Content-Type:application/x-www-form-urlencoded)发送到下面的Controller会导致HTTP415UnsupportedMediaType响应。publicclassMyController:Controller{[HttpPost]publicasyncTaskSubmit([FromBody]MyModelmodel){//...}}表单发布HTTPheader:POST/submitHTTP/1.1Host:example.com:1337Connection:keep-aliveContent-Leng

c# - Properties.Settings.Default 存储在哪里?

我以为我知道这一点,但今天我再次被证明是错误的。运行VS2008、.NET3.5和C#。我使用默认值将用户设置添加到属性设置选项卡,然后使用以下代码读取它们:myTextBox.Text=Properties.Settings.Default.MyStringProperty;然后,当用户在选项对话框中编辑值后,我将其保存为:Properties.Settings.Default.MyStringProperty=myTextBox.Text;Properties.Settings.Default.Save();我的问题是,这个新值保存在哪里?可执行目录中的MyApp.exe.conf

c# - Properties.Settings.Default 存储在哪里?

我以为我知道这一点,但今天我再次被证明是错误的。运行VS2008、.NET3.5和C#。我使用默认值将用户设置添加到属性设置选项卡,然后使用以下代码读取它们:myTextBox.Text=Properties.Settings.Default.MyStringProperty;然后,当用户在选项对话框中编辑值后,我将其保存为:Properties.Settings.Default.MyStringProperty=myTextBox.Text;Properties.Settings.Default.Save();我的问题是,这个新值保存在哪里?可执行目录中的MyApp.exe.conf

c# - 如何在 ASP.NET Core 中启用 CORS

我正尝试在我的ASP.NETCoreWebAPI上启用跨源资源共享,但我卡住了。EnableCors属性接受string类型的policyName作为参数://Summary://CreatesanewinstanceoftheMicrosoft.AspNetCore.Cors.Core.EnableCorsAttribute.////Parameters://policyName://Thenameofthepolicytobeapplied.publicEnableCorsAttribute(stringpolicyName);policyName是什么意思,如何在ASP.NETC