小编Mir*_*hat的帖子

无法解析“.NETCoreApp,版本=v2.1”的“Microsoft.NETCore.App (>= 2.1.0)”

我正在尝试使用 解析块金包dotnet restore,但收到以下错误:

无法解析“.NETCoreApp,版本=v2.1”的“Microsoft.NETCore.App (>= 2.1.0)”

这是我的.csproj文件

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Autofac" Version="4.5.0" />
    <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
    <PackageReference Include="Autofac.Extras.Moq" Version="4.2.0" />
    <PackageReference Include="BCrypt.Net-Core" Version="1.4.0" />
    <PackageReference Include="Easy.MessageHub" Version="3.2.1" />
    <PackageReference Include="hangfire" Version="1.6.17" />
    <PackageReference Include="Hangfire.MemoryStorage" Version="1.5.2" />
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0-rc1-final" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.0-rc1-final" />
    <PackageReference Include="MongoDB.Driver" Version="2.4.4" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="1.1.0" />
    <PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
  </ItemGroup>

  <Target Name="ApplyXdtConfigTransform" BeforeTargets="_TransformWebConfig">
    <PropertyGroup>
      <_SourceWebConfig>$(MSBuildThisFileDirectory)Web.config</_SourceWebConfig>
      <_XdtTransform>$(MSBuildThisFileDirectory)Web.$(Configuration).config</_XdtTransform>
      <_TargetWebConfig>$(PublishDir)Web.config</_TargetWebConfig>
    </PropertyGroup>
    <Exec Command="dotnet …
Run Code Online (Sandbox Code Playgroud)

.net c# visual-studio .net-core

5
推荐指数
3
解决办法
1万
查看次数

如果在 IIS 中作为虚拟目录运行,.net 核心应用程序错误 502.5

我在配置 .net 核心应用程序以在 iis 中作为虚拟目录工作时遇到问题。如果我直接用它的端口启动 .net 核心应用程序,它工作正常。

我收到 502.5 响应,在事件查看器中有此消息

Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical root 'C:\inetpub\wwwroot\' failed to start process with commandline ' ', ErrorCode = '0x80070057 : 0.
Run Code Online (Sandbox Code Playgroud)

我已经像这样删除了 .net web.config 中的父处理程序

<handlers>
            <remove name="httpPlatformHandler"/>
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        </handlers>
Run Code Online (Sandbox Code Playgroud)

.net c# windows deployment iis

5
推荐指数
1
解决办法
889
查看次数

如何在进入 Controller 之前调试 .net 中的待处理请求

如何在不进入控制器的情况下调试对 Web Api 保持挂起状态的 HTTP 请求?

这是我的要求

curl " http://localhost:50086/foo/bar " -X OPTIONS -H "Access-Control-Request-Method: POST" -H "Origin: http://localhost:3333 " -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116" -H "Access-Control-Request-type,Headers: content x-auth-token" --compressed

EventLog 和 Debug 控制台中没有任何内容。这些待处理的请求随机发生,在重新启动应用程序之前不会通过(在某些情况下,它们进入控制器但经过很长时间)。

我正在使用 .net Core 2.2

.net c# .net-core

3
推荐指数
1
解决办法
1607
查看次数

如何指定播放服务位置

我想使用 googlePlayServicesVersion 16.1.0,但我得到

找不到 com.google.android.gms:play-services-location:16.1.0

我尝试添加implementation 'com.google.android.gms:play-services-location:16.0.0'内部 app/build.gradle 依赖项

我已经添加googlePlayServicesVersion = "16.1.0"到 android/build.gradle 里面

android google-play-services android-gradle-plugin

3
推荐指数
1
解决办法
1万
查看次数

如何从.net Core 2.2中的appsettings.json中读取日志配置

在.net Core 2.1中,它是这样完成的

var loggingConfig = configuration.GetSection("Logging");
loggerFactory.AddConsole(loggingConfig);
Run Code Online (Sandbox Code Playgroud)

我已经将其移动到ConfigureServices,现在我得到了

错误CS1503参数2:无法从“ Microsoft.Extensions.Configuration.IConfigurationSection”转换为“ System.Action Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions”

.net c# .net-core

2
推荐指数
1
解决办法
1697
查看次数