Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:46:26+00:00 2026-06-13T10:46:26+00:00

I am currently working on a project which features a plugin-like system. Once the

  • 0

I am currently working on a project which features a plugin-like system. Once the web project starts up it looks for plugin dlls and build up the GUI. The dlls contain embedded views, and embedded resources like pictures or javascripts.

  • I use RazorGenerator(VS Plugin) to generate the cs files from the views, The build action of the views is set to ’embedded resource’ and the custom tool is set to ‘RazorGenerator’

  • I use a custom Virtual Path Provider (a very similar to this one)

  • I register my virtual path provider with this workaround i found on the net (it is a must since it is not working as intented if i dont use this):

        var assemblyResourceProvider = new AssemblyResourceProvider();
        var hostingEnvironmentInstance = (HostingEnvironment)typeof(HostingEnvironment).InvokeMember("_theHostingEnvironment", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField, null, null, null);
        if (hostingEnvironmentInstance == null)
            return;
    
        var mi = typeof(HostingEnvironment).GetMethod("RegisterVirtualPathProviderInternal", BindingFlags.NonPublic | BindingFlags.Static);
        if (mi == null)
            return;
    
        mi.Invoke(hostingEnvironmentInstance, new object[] { assemblyResourceProvider });
    
  • I use this at my RouteConfig.cs to make the embedded script and picture files work:

       routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(css|js|gif|png|jpg|exe)(/.*)?" });
    
  • I add these lines (there are more) to my web.config to tell asp to use my path provider for my embedded sources:

      <add name="AspNetStaticFileHandler-PNG" path="*.png" verb="GET,HEAD" type="System.Web.StaticFileHandler"/>
    
  • I use the Boc.Web.PrecompiledViews dll to register the path attributes generated by RazorGenerator

    BoC.Web.Mvc.PrecompiledViews.ApplicationPartRegistry.Register(assembly);
    

Everything is working as intended in Visual Studio. The views and resources embedded in a dll are showing and working flawlessly. I also use IIS 7.5 to run my web app from Visual Studio. All of the possibilities work:

  • it works if i give the virtual path generated by Razor Generator (ex: “~/Views/ViewTest/Test)
  • it works if i give the Dll resources path which uses my resourceprovider (ex: “DllResources/ViewTest.dll/Views/ViewTest/Test.cshtml)

However, after i deploy my web app and run it using IIS 7.5, the Views(only the views!) are not showing! If i address the views with the virtual path (option 1), IIS gives this error message:

    The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:

if i address the views with the DllResources path (option 2), IIS gives this error message:

    The file '/Views/ViewTest/DllResources/EmbeddedResourceTest/Views/ViewTest/Test.cshtml' has not been pre-compiled, and cannot be requested.

I dont know what to do now to make it work. I have tried to replace every single step with other solutions. The result is still the same. Flawlessly working in VS, but the views are not showing after deployment.

Is it some config for the IIS what is missing? am i missing something from the web.config?
Please help me with this issue.

Thanks,
Norbert

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:46:27+00:00Added an answer on June 13, 2026 at 10:46 am

    Okay, after 1 week of suffering i have finally came up with the solution.
    The problem was with the publishing of the web project.
    Here is what i did:

    i’ve been publishing my web app with aspnet_compiler in the Microsoft.Net folder. This was a Post-build event triggered by successful Web project builds. I removed this event and replaced it with an “AfterBuild” script in the .csproj file of the web project. I found the script on this question. With this new publish method the embedded views are finally showing.

    Hope this helps someone in the future.

    Regards,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have currently been working on a web application which features a dynamically updating
I'm currently working on my project which consists of front and back-end written in
I am currently working on a project which creates a dictionary with an int
I am currently working on an android project which lists all of the apps
Our team is currently working on a large project which makes heavy use of
I'm currently working on a Haskell project which automatically tests some functions based on
I'm currently working on a little project in which I'm trying to create a
Currently we are working on a project in which we need to come up
Currently I am working with the project in which I need to parse complex
I'm currently working on a hobby project (C/C++) which is supposed to work on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.