Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos 无法运行 #15

Closed
nonepassby opened this issue Jan 25, 2018 · 1 comment
Closed

centos 无法运行 #15

nonepassby opened this issue Jan 25, 2018 · 1 comment

Comments

@nonepassby
Copy link

使用Util.Core做了一个hello world,在windows环境下运行正常,但是发布到linux(centos7 mini)环境下运行时报错,估计是反射相关方法引起的,错误提示如下:
[root@localhost utiltest]# dotnet utiltest.dll
Application startup exception: System.IO.FileNotFoundException: Could not load file or assembly 'utiltest.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'utiltest.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.AppDomain.Load(AssemblyName assemblyRef)
at Util.Reflections.Finder.LoadAssemblies(String path)
at Util.Reflections.WebFinder.GetAssemblies()
at Util.Dependency.DependencyConfiguration.RegistServices(ContainerBuilder builder)
at Util.Dependency.Container.CreateBuilder(IServiceCollection services, Action1 actionBefore, IConfig[] configs) at Util.Dependency.Container.Register(IServiceCollection services, Action1 actionBefore, IConfig[] configs)
--- 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()

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'utiltest.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.AppDomain.Load(AssemblyName assemblyRef)
at Util.Reflections.Finder.LoadAssemblies(String path)
at Util.Reflections.WebFinder.GetAssemblies()
at Util.Dependency.DependencyConfiguration.RegistServices(ContainerBuilder builder)
at Util.Dependency.Container.CreateBuilder(IServiceCollection services, Action1 actionBefore, IConfig[] configs) at Util.Dependency.Container.Register(IServiceCollection services, Action1 actionBefore, IConfig[] configs)
--- 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()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at utiltest.Program.Main(String[] args) in C:\Users\nonep\source\repos\utiltest\utiltest\Program.cs:line 17
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
Application startup exception
System.IO.FileNotFoundException: Could not load file or assembly 'utiltest.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'utiltest.PrecompiledViews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.AppDomain.Load(AssemblyName assemblyRef)
at Util.Reflections.Finder.LoadAssemblies(String path)
at Util.Reflections.WebFinder.GetAssemblies()
at Util.Dependency.DependencyConfiguration.RegistServices(ContainerBuilder builder)
at Util.Dependency.Container.CreateBuilder(IServiceCollection services, Action1 actionBefore, IConfig[] configs) at Util.Dependency.Container.Register(IServiceCollection services, Action1 actionBefore, IConfig[] configs)
--- 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()

Aborted

@UtilCore
Copy link
Contributor

你好,这是由于在启动时,AddUtil方法扫描程序集导致的,这个方法现在还无法垮平台,可以先手工调用Ioc.Register注册autofac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants