2016-01-12 6 views
7

を公開した後、私は働き、(Visual StudioまたはVSコードから私は何の問題を起動することはできません)開発の細かい動作しますAsp.net 5 Webアプリケーションを持っています。Asp.net 5 Webアプリケーションの起動例外の成功は

Application startup exception: System.IO.FileNotFoundException: Could not load file or assembly 'my-ng2-website' or one of its dependencies. The system cannot find the file specified. 
 
File name: 'my-ng2-website' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002) 
 
    at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) 
 
    at System.Reflection.Assembly.LoadFile(String path) 
 
    at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath) 
 
    at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext) 
 
    at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName) 
 
    at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName) 
 
    at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName) 
 
    at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory) 
 
    at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName) 
 
    at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args) 
 
    at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) 
 
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
 
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
 
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
 
    at System.Reflection.Assembly.Load(AssemblyName assemblyRef) 
 
    at Microsoft.AspNet.Hosting.Startup.StartupLoader.FindStartupType(String startupAssemblyName, IList`1 diagnosticMessages) 
 
    at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureStartup() 
 
    at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureApplicationServices() 
 
    at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()

私は高い検索しています:首尾アプリを公開した後にウェブサイトを立ち上げるしようとしたときただし、次のエラーが表示され、これまでロードからウェブサイトを防ぐ「web.cmd」ソリューションのための低。どのような依存関係がないのか分かりません。ここで enter image description here

の設定です:私は

ここ

は、プロジェクトのための私のDNXコンフィグ設定がされて復元DNU package.lock.json

を削除

を試してみました公開:

enter image description here

誰もがこれらの茶葉を読むことができますか?

+0

変更**私の-NG2-ウェブサイトを設定する公開** **私の-NG2-ウェブサイトをコンパイルするにpublishExcludeに追加してください上のコンパイルオプションでプロジェクトを公開する場合** – ymz

+0

はい、それはタイプミスですが、実際のパブリッシュ設定はまったく異なるものです。私はここに表示するために "my-ng2-website"を作成しました – brando

+0

アセンブリは公開されていますか?あるいは、公開時に名前が変更されている可能性があります。 – jtlowe

答えて

1

はちょうどそれの一体のために、私はfalseに「Nugetパッケージにソースファイルをコンパイル」に設定します。そして今、それは動作します。

enter image description here

それが動作なぜ、私は知りません。しかし、うまくいけば、これは誰かを助けるでしょう。

1

良い一日。私たちはこの種のエラーで遭遇することはほとんどありませんでした。多くの場合、欠落しているアセンブリ(最も一般的なもの)を指すことがあります。必要なすべての参照をチェックし、ローカルコピー - > trueに設定すると、ほとんどの場合役に立ちます。アセンブリ/参照は、Copy Localに設定されている場合は公開に含まれないため、falseを返します。

これが役に立ちます。

+0

コピーローカル - >真はどこで設定しますか?パブリックプロファイルには、CopyLocalFilesOutputGroupDependsOn設定があります。 – brando

+0

私はパブリックプロファイルではなく、パブリックプロファイルを意味します – brando

0

このエラーは、プロジェクトディレクトリにあるファイルglobal.json(ないソリューション1)とは何かを持っています。あなたのproject.json

"publishExclude": [ 
    "**.user", 
    "**.vspscc", 
    "global.json" 
], 
関連する問題