2017-12-07 14 views
0

サービスに問題があります。私は、Advanced Installerのインストールファイルを使ってサービスをインストールしています。インストールした後は、開発サーバーでうまく動作します。しかしサービスは1つのサーバーで実行されていますが、別のサーバーで実行されていません〜タイプ名またはエイリアスxxxを解決できませんでした

、次のエラーメッセージと起動時にサービスがクラッシュし、別のサーバー上の同じインストールファイルを使用してサービスをインストールしようとしている:手動でサービスファイルを開始するために、コンソールを使用し

Description: The process was terminated due to an unhandled exception. 
Exception Info: System.InvalidOperationException 
    at Microsoft.Practices.Unity.Configuration.ConfigurationHelpers.TypeResolverImpl.ResolveType(System.String, Boolean) 
    at Microsoft.Practices.Unity.Configuration.RegisterElement.GetRegisteringType() 
    at Microsoft.Practices.Unity.Configuration.RegisterElement.ConfigureContainer(Microsoft.Practices.Unity.IUnityContainer) 
    at Microsoft.Practices.Unity.Configuration.ContainerElement+<>c__DisplayClass1.<ConfigureContainer>b__0(Microsoft.Practices.Unity.Configuration.ContainerConfiguringElement) 
    at Microsoft.Practices.ObjectBuilder2.EnumerableExtensions.ForEach[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Action`1<System.__Canon>) 
    at Microsoft.Practices.Unity.Configuration.ContainerElement.ConfigureContainer(Microsoft.Practices.Unity.IUnityContainer) 
    at Microsoft.Practices.Unity.Configuration.UnityConfigurationSection.Configure(Microsoft.Practices.Unity.IUnityContainer, System.String) 
    at Microsoft.Practices.Unity.Configuration.UnityContainerExtensions.LoadConfiguration(Microsoft.Practices.Unity.IUnityContainer, Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, System.String) 
    at Microsoft.Practices.Unity.Configuration.UnityContainerExtensions.LoadConfiguration(Microsoft.Practices.Unity.IUnityContainer, Microsoft.Practices.Unity.Configuration.UnityConfigurationSection) 
    at NFCommonImplementation.Factory.NfUnityContainer..ctor() 
    at NFCommonImplementation.Factory.NfUnityContainer.get_Instance() 
    at NFObjectFactory.CommonObjectFactory..ctor() 
    at NFObjectFactory.CommonObjectFactory.<.cctor>b__0() 
    at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateValue() 
    at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].LazyInitValue() 
    at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Value() 
    at NFDataImporter.ImportService.<Start>b__2() 
    at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) 
    at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
    at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
    at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 
    at System.Threading.ThreadHelper.ThreadStart() 

(次のようにこれtopshelf使用しています)、エラーを指定します。

Topshelf.Hosts.ConsoleRunHost Critical: 0 : The service threw an unhandled exception, System.InvalidOperationException: The type name or alias INetReportDao could not be resolved. Please check your configuration file and verify this type name. 

私はすでに読み込みユニティ・コンフィギュレーション・ファイルを、チェックしました

また、NFCommonImplementation.dllとNFCommonInterfaces.dllがサービス実行可能ファイルのすぐ隣にあることも確認しました。

今私はウィットの終わりです。理論的には、インストーラは両方のサーバーに全く同じバージョンのサービスをインストールするため、動作するはずです。しかし、何らかの理由で、あるサーバーで動作し、別のサーバーでは動作しません。

私は依存関係が不足している可能性がありますか?インストーラはVisual Studio 2012のVisual C++ Redistributableへの依存関係を自動的に認識してインストールします。この問題を引き起こす可能性があるテストサーバーではなく、開発サーバーにインストールされる可能性のある他の依存関係が存在する可能性がありますか?

答えて

0

オーケーは、いくつかの調査の後、私は問題を解決する方法を考え出し、およびいくつかのより多くの調査の後、私はそれを引き起こしていたものを見つけた:

修正を:

行方不明の.dllがする必要がありますGACにインストールする。そうするための最も簡単な方法は、followinh PowerShellスクリプトを使用している:

Set-location "[dll file location]"    
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")    
$publish = New-Object System.EnterpriseServices.Internal.Publish    
$publish.GacInstall("[dll file name]") 

原因:

開発サーバ上で

は、ビルドプロセスがサービスだったカスタムアセンブリキャッシュに問題になっているの.dllをインストールそのサーバーで実行されている場合はアクセスできます。しかし、他のサーバー上でそれらのファイルを見つけることは当然不可能でした。

これは、これが同様の困難を経験している他の人に役立つことを願っています。

関連する問題