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

InvalidOperationException: Can not find assembly file Microsoft.DotNet.Cli.Utils.dll #17

Closed
dfederm opened this issue Jul 3, 2016 · 5 comments

Comments

@dfederm
Copy link

dfederm commented Jul 3, 2016

This could very well be something I have configured wrong, but I'm attempting to upgrade from AspNetCore RC1 to 1.0 and I'm getting this error after deploying using the PublishWebPackage build task and trying to hit the site (It's a runtime exception):

InvalidOperationException: Can not find assembly file Microsoft.DotNet.Cli.Utils.dll at 'D:\home\site\wwwroot\refs,D:\home\site\wwwroot\'

I am able to deploy manually through Visual Studio successfully, so I believe the site itself is working as expected, but it's just not getting deployed correctly through the VSTS task.

Some more context:

  • I'm targeting net461 (I have a few dependencies which won't let me use .Net Core yet)
  • Publish command: dotnet publish -c $(BuildConfiguration) -o $(Build.StagingDirectory)\Publish --no-build. I'm not using your VSTS task since I need to restore and build some test projects too and it's a bit faster to do those in bulk. This should be more or less the same command your task runs though, except I think the -o param is a bit deeper with yours but I believe that's addressed in my PublishWebPackage settings.
  • PublishWebPackage settings:
    • Source: $(Build.StagingDirectory)\Publish
    • Destination: site/wwwroot (the default)
    • Stop Before Deploy, Clean Before Deploy, Restart After Deploy are all set.
  • Azure Virtual applicationand directories set to site\wwwroot (the default I believe)
  • Interestingly I've downloaded the site contents via https://{websitename}-{slot}.scm.azurewebsites.net/api/zip/site/wwwroot both when deploying via VS and when deploying through your task and in both cases the Microsoft.DotNet.Cli.Utils.dll file is missing, but I only get the error when using the VSTS task. Also from a quick spot check, the contents seem identical to me in both cases, adding to my confusion.

Any ideas?

@dfederm
Copy link
Author

dfederm commented Jul 3, 2016

This might be similar to aspnet/Entropy#129

@dfederm
Copy link
Author

dfederm commented Jul 3, 2016

Yup, definitely an issue with the CLI and the same issue as aspnet/Entropy#129. I was able to mitigate it using the same mitigation they did. Sorry for the false alarm :)

@dfederm dfederm closed this as completed Jul 3, 2016
@kirkone
Copy link
Owner

kirkone commented Jul 4, 2016

Hi,

thanks for sharing this.
Maybe someone else run into this issue and can have a look here.

I also have some projects running on net461. So far I did not have this issue but I have no idea why. :(

Greetings,
KirK

@xtrem14
Copy link

xtrem14 commented Sep 20, 2016

Hello,

I encounter the same problem on IIS but not in Visual Studio.
Error :

System.InvalidOperationException: Can not find assembly file Microsoft.DotNet.Cli.Utils.dll at 'C:\inetpub\wwwroot\MySite\refs,C:\inetpub\wwwroot\MySite'
à Microsoft.Extensions.DependencyModel.Resolution.AppBaseCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List1 assemblies) à Microsoft.Extensions.DependencyModel.Resolution.CompositeCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List1 assemblies)
à Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
à System.Linq.Enumerable.d__162.MoveNext() à Microsoft.AspNetCore.Mvc.Razor.Compilation.MetadataReferenceFeatureProvider.PopulateFeature(IEnumerable1 parts, MetadataReferenceFeature feature)
à Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
à Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.GetCompilationReferences()
à System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func1 valueFactory) à Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.get_CompilationReferences() à Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.Compile(RelativeFileInfo fileInfo, String compilationContent) à Microsoft.AspNetCore.Mvc.Razor.Internal.RazorCompilationService.Compile(RelativeFileInfo file) à Microsoft.AspNetCore.Mvc.Razor.Internal.CompilerCache.CreateCacheEntry(String relativePath, String normalizedPath, Func2 compile)
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Mvc.Razor.Internal.CompilerCache.GetOrAdd(String relativePath, Func2 compile) à Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorPageFactoryProvider.CreateFactory(String relativePath) à Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet1 expirationTokens, String relativePath, Boolean isMainPage)
à Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.OnCacheMiss(ViewLocationExpanderContext expanderContext, ViewLocationCacheKey cacheKey)
à Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromViewLocations(ActionContext actionContext, String pageName, Boolean isMainPage)
à Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
à Microsoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
à Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor.FindView(ActionContext actionContext, ViewResult viewResult)
à Microsoft.AspNetCore.Mvc.ViewResult.d__26.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__32.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__31.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__29.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__23.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__18.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Session.SessionMiddleware.d__9.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à Microsoft.AspNetCore.Session.SessionMiddleware.d__9.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.<Invoke>d__18.MoveNext() --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée --- à Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.d__6.MoveNext()

Can you help me @pakrym ?

Thank's for your help,
Regards,

@johanskoldekrans
Copy link

I just got this when I publish my site to IIS. I have no problem running it locally, no problem compiling and running from git with kestrel on the same web server as my iis. But through IIS it has just stopped working.

I get the same error as above through the IIS and have no clue as to why it has started to occur or how to resolve. The thing is I publish at least twice daily and have done so since july. Now I am up to running 1.1.0-alpha1-* of dotnet core and I guess something has changed in the nightly builds that I havent been good enough to handle.

What info do I send to be able to help and get helped?!

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

4 participants