This is a migrated thread and some comments may be shown as answers.

Issue with 1.3.0 when deploying to IIS

1 Answer 116 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kenny
Top achievements
Rank 2
Kenny asked on 16 Jul 2019, 03:35 PM

I am running 1.3.0 and .Net Core preview 6

This is a server side Blazor application.

Locally the project runs fine, but when I deploy to IIS I get the following error when I hit the page:

An error occurred while starting the application.
DirectoryNotFoundException: C:\Users\longk\.nuget\packages\telerik.ui.for.blazor\1.3.0\staticwebassets\
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root, ExclusionFilters filters)
DirectoryNotFoundException: C:\Users\longk\.nuget\packages\telerik.ui.for.blazor\1.3.0\staticwebassets\
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root, ExclusionFilters filters)
Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(string root)
Microsoft.AspNetCore.StaticWebAssetsFileProvider..ctor(string pathPrefix, string contentRoot)
Microsoft.AspNetCore.StaticWebAssetsLoader+<>c.<UseStaticWebAssetsCore>b__2_0(ContentRootMapping cr)
System.Linq.Enumerable+SelectEnumerableIterator<TSource, TResult>.MoveNext()
System.Linq.Enumerable.OfTypeIterator<TResult>(IEnumerable source)+MoveNext()
System.Collections.Generic.List<T>..ctor(IEnumerable<T> collection)
System.Linq.Enumerable.ToList<TSource>(IEnumerable<TSource> source)
Microsoft.AspNetCore.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
Microsoft.AspNetCore.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment)
Microsoft.AspNetCore.WebHost+<>c.<ConfigureWebDefaults>b__9_0(WebHostBuilderContext ctx, IConfigurationBuilder cb)
Microsoft.AspNetCore.Hosting.Internal.GenericWebHostBuilder+<>c__DisplayClass8_0.<ConfigureAppConfiguration>b__0(HostBuilderContext context, IConfigurationBuilder builder)
Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
Microsoft.Extensions.Hosting.HostBuilder.Build()
ScheduledFeatureEditor.Program.Main(string[] args) in Program.cs

 

NOTE: The directory that is saying is not found is my local directory on the build machine, not the server that I deployed to.  I'm not sure where that is coming from.

I am not using static assets (or at least I don't think I am).  Here is my script reference from _Host.cshtml:

    <script src="https://kendo.cdn.telerik.com/blazor/1.3.0/telerik-blazor.min.js" defer></script>

 

Here are some snippets from Startup that show I am including the telerik blazor stuff:

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            services.AddTelerikBlazor();

And also I am including static file handling in startup:

            app.UseStaticFiles();

If I change the code to use the static asset version like this:

    <script src="_content/telerikuiforblazor/js/telerik-blazor.js" defer></script>

and then redeploy I get the same error.

 

Any ideas?

 

Thanks,

Kenny Long

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Jul 2019, 12:20 PM
Hi Kenny,

I just answered your support ticket on this matter, and I am pasting my response here for anyone else having the same problem.

Am I correct in understanding that by "deploy" you mean that the IIS server is a different PC than yours? If so, you are likely hitting this issue: https://github.com/aspnet/AspNetCore/issues/11185 which should be fixed in the upcoming Preview 7. The stack trace does not include our methods, which is why I believe it is the issue with the static asset handling in the framework.

We had a similar report (here) which also indicates that perhaps the "publish" package is not enough and installing the full .NET Core 3 SDK on the server may help. So, if you can give that a shot, I'd appreciate if you let me know how it went.



Regards,
Marin Bratanov
Progress Telerik UI for Blazor
Tags
General Discussions
Asked by
Kenny
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or