Page 1 of 1

Cannot find compilation library location for package 'Micros

Posted: Sat Jun 08, 2019 1:28 am
by bighugedave

I have other .NET Core applications running on a windows web server, running IIS. I cannot for the life of me get this website running on my webserver. I usually just have to copy the 'publish' directory to the web server and point it to that within IIS and everything just works fine. But now, with version 2019.0.6 I see the above error repeated in the error log file. I won't post the entire error log, of course, but here's the first several lines:

Hosting environment: Production
Content root path: D:\QMISDBAdmin2019\bin\Debug\netcoreapp2.1\publish
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Cannot find compilation library location for package 'Microsoft.AspNet.WebApi.Client'

Then I get a 500 error on the page.

Strange thing is, if I browse the app after generating it with ASP.Net Maker it runs fine, but just not within IIS.

Any ideas or suggestions would be greatly appreciated.

Kind regards,

David


Re: Cannot find compilation library location for package 'Mi

Posted: Sat Jun 08, 2019 8:08 am
by MichaelG

Try delete ALL files and folders in both destination folder, then regenerate ALL files again. Make sure that you clean up the publish folder also before uploading.


Re: Cannot find compilation library location for package 'Mi

Posted: Sat Jun 15, 2019 12:18 am
by bighugedave

I tried deleting all files, tried suggestions from StackOverflow and other sites, but to no avail. As of right now I can't host applications created with version 2019.

Thanks,
David


Re: Cannot find compilation library location for package 'Mi

Posted: Sat Jun 15, 2019 7:22 am
by MichaelG

Content root path: D:\QMISDBAdmin2019\bin\Debug\netcoreapp2.1\publish

You have "netcoreapp2.1". Are you sure your server has the Runtime and Hosting Bundle for .NET Core 2.1 or newer installed. If it only has older version (e.g. that for .NET Core 2.0), it won't work.

Before you build the application for publish, delete ALL files and folders and generate ALL files and folders again. See if it will help.


Re: Cannot find compilation library location for package 'Mi

Posted: Mon Jun 17, 2019 2:22 am
by bighugedave

The thing that resolved it was setting the following key to true in the csproj file: <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>

I'm not sure why this resolved it, but it did. I looked at posts all over the place to resolve it and just tried switching this for the heck of it, and it worked.

I hope this helps anyone else having a similar issue.


Re: Cannot find compilation library location for package 'Mi

Posted: Mon Jun 17, 2019 9:13 am
by MichaelG

I don't think that setting is related, I guess changing that setting triggers re-compilation of latest generated scripts.