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

  • Home
  • SEARCH
  • 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 7756885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:56:16+00:00 2026-06-01T12:56:16+00:00

I tried following some of the code from here and here , but I

  • 0

I tried following some of the code from here and here, but I am getting an error on the page when trying to reference the remote view located in a separate project: “Value cannot be null. Parameter name: stream”

Below is my AssemblyResourceProvider and controller in my master MVC 4 project. I have also attached the whole solution itself here. Can anyone help to see what is going wrong? Thanks for any help or suggestions.

public class AssemblyResourceProvider : System.Web.Hosting.VirtualPathProvider
    {
        private bool IsAppResourcePath(string virtualPath)
        {
            string checkPath = VirtualPathUtility.ToAppRelative(virtualPath);
            return checkPath.StartsWith("~/Plugin/", StringComparison.InvariantCultureIgnoreCase);
        }

        public override bool FileExists(string virtualPath)
        {
            return IsAppResourcePath(virtualPath) || base.FileExists(virtualPath);
        }

        public override VirtualFile GetFile(string virtualPath)
        {
            return IsAppResourcePath(virtualPath)
                ? new AssemblyResourceVirtualFile(virtualPath)
                : base.GetFile(virtualPath);
        }

        public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            return !IsAppResourcePath(virtualPath)
                ? base.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart)
                : null;
        }
    }

    public class AssemblyResourceVirtualFile : VirtualFile
    {
        string path;

        public AssemblyResourceVirtualFile(string virtualPath) : base(virtualPath)
        {
            path = VirtualPathUtility.ToAppRelative(virtualPath);
        }

        public override Stream Open()
        {
            string[] parts = path.Split('/');
            string assemblyName = parts[2];
            string resourceName = parts[3];

            var assembly = Assembly.LoadFile(Path.Combine(HttpRuntime.BinDirectory, assemblyName));

            return assembly != null
                ? assembly.GetManifestResourceStream(resourceName)
                : null;
        }
    }

And my home controller:

public ActionResult Pluggable()
{
    //ViewBag.Name = name;
    return View("~/Plugin/PluginView1.dll/PluginView1.Views.Home.Pluggable.cshtml");
}

enter image description here

  • 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-01T12:56:18+00:00Added an answer on June 1, 2026 at 12:56 pm

    Here is my AssemblyResourceVirtualFile that I used in a project before:

    public class AssemblyResourceVirtualFile : VirtualFile
    {
        string path;
        public AssemblyResourceVirtualFile(string virtualPath) : base(virtualPath)
        {
            path = VirtualPathUtility.ToAppRelative(virtualPath);
        }
        public override System.IO.Stream Open()
        {
            string[] parts = path.Split('/');
            string assemblyName = parts[2];
            string resourceName = parts[3];
    
            assemblyName = Path.Combine(HttpRuntime.BinDirectory, assemblyName);
    
            System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(assemblyName);
            if (assembly != null)
            {
                Stream resourceStream = assembly.GetManifestResourceStream(resourceName);
                return resourceStream;
            }
            return null;
        }
    }
    

    Really the only difference is I’ve made it so you can stick break points in there and walk to see what it finds. Put your break point in and walk the code, is the assembly == null? If not, is resourceStream null?

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

Sidebar

Related Questions

I keep getting the following error when trying to parse some html using BeautifulSoup:
I'm running some code through JSHint and I keep getting the following error: Don't
I tried to update some part of a matrix, I got the following error
I want to add some html in an email. I've tried the following. vFromName
I just tried disassembling some shellcode using disasm and I found the following statement
In the following example (apologies for the length) I have tried to isolate some
Tried following the instructions here: How to use Google app engine with my own
I tried following the instruction s but can't get the plugin to work, the
I tried following the gradle manual with their example like this but copyJars is
I tried following the answer here how to override a task making it depend

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.