首页新闻找找看学习计划

关于.netcore发布了网站后,在IIS中的问题

0
悬赏园豆:10 [已解决问题] 解决于 2017-03-11 18:02

发布后,在windows2008(已经装好了vc_redist.x64、DotNetCore.1.1.0-WindowsHosting)的IIS上面访问,直接报错,如下

复制代码
Application startup exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-registry-l1-1-0.dll': 找不到指定的模块。 (Exception from HRESULT: 0x8007007E)
   at Interop.mincore.RegOpenKeyEx(SafeRegistryHandle hKey, String lpSubKey, Int32 ulOptions, Int32 samDesired, SafeRegistryHandle& hkResult)
   at Microsoft.Win32.RegistryKey.InternalOpenSubKeyCore(String name, RegistryRights rights, Boolean throwOnPermissionFailure)
   at Microsoft.AspNetCore.DataProtection.RegistryPolicyResolver.ResolveDefaultPolicy()
   at Microsoft.Extensions.DependencyInjection.DataProtectionServices.<GetDefaultServices>d__0.MoveNext()
   at Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAdd(IServiceCollection collection, IEnumerable`1 descriptors)
   at Microsoft.Extensions.DependencyInjection.DataProtectionServiceCollectionExtensions.AddDataProtection(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViewServices(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViews(IMvcCoreBuilder builder)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services)
   at AppServiceByYc.Service.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Hosting environment: Production
复制代码

不清楚问题在哪里,请知道的大神 指点下小弟

NoRoadZH的主页 NoRoadZH | 初学一级 | 园豆:195
提问于:2017-03-11 17:08
< >
分享
最佳答案
0

自己已经解决了

就是发布的时候  必须要指定 你服务器的系统类型发布 要不然 以当前的系统发布 可能会不兼容

给个群友给的 发布程序

@echo off
echo 开始编译
pause
dotnet restore

echo 选择编译到哪个操作系统
echo 0------all
echo 1------win7-x64
echo 2------win10-x64
echo 3------centos.7-x64
echo 4------osx.10.10-x64
echo 5------osx.10.11-x64
echo 6------osx.10.12-x64
echo 7------win7-x86

set /p input=操作系统:

if %input%==1 (
    dotnet publish -r win7-x64 -c release
)
if %input%==2 (
    dotnet publish -r win10-x64 -c release
)
if %input%==3 (
    dotnet publish -r centos.7-x64 -c release
) 
if %input%==4 (
    dotnet publish -r osx.10.10-x64 -c release
) 
if %input%==5 (
    dotnet publish -r osx.10.11-x64 -c release
) 
if %input%==6 (
    dotnet publish -r osx.10.12-x64 -c release
) 
if %input%==7 (
    dotnet publish -r win7-x86 -c release
) 

if %input%==0 (
    dotnet publish -r win7-x64 -c release
    dotnet publish -r win10-x64 -c release
    dotnet publish -r centos.7-x64 -c release
    dotnet publish -r osx.10.10-x64 -c release
    dotnet publish -r osx.10.11-x64 -c release
    dotnet publish -r osx.10.12-x64 -c release
    dotnet publish -r win7-x86 -c release
) 


echo 按任意键退出
pause
NoRoadZH | 初学一级 |园豆:195 | 2017-03-11 17:57
其他回答(1)
0
收获园豆:10
dudu | 园豆:41258 (高人七级) | 2017-03-11 17:16

这个文章 好像是 部署系统和开发系统一样把

我现在是 开发在win10  部署系统是 win2008

是不是要指定发布才行

支持(0) 反对(0) NoRoadZH | 园豆:195 (初学一级) | 2017-03-11 17:25

还有就是 之前 在2008上面 发布了一个都是好的,今天就重新发布了网站就出问题了

支持(0) 反对(0) NoRoadZH | 园豆:195 (初学一级) | 2017-03-11 17:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册