Reputation: 5876
I have a production system and test system, both running IIS. IN the production system, everything runs fine. In the test system, I have a directed copy of the folder the site code is contained in which is set up as a virtual directory. The App_Code folder is in the root and contains all the .cs files. When running the same site in test, I get a
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'SPTasks.master'.
Source Error:
Line 1: <%@ Master Language="C#" inherits="SPTasks.master"%>
Line 2: <html>
Line 3: <head runat="server">
Source File: /SPTasks/master.master Line: 1
Any idea why this would be coming in test and not in production? Is the code not compiling for some reason?
Thanks!
Upvotes: 1
Views: 3340
Reputation: 7705
Some of the comments have asked about MVC, but this looks like a WebForms application - correct me if I'm wrong? In the past I've seen this error if the application has not yet been compiled. You mention that you're copying files across one at a time. Have you actually compiled the application? If there's no dll in the bin folder containing the compiled code for your SPTasks.master.cs
class, you'll get this error. As you're not using VS to compile your application, you'll need to use csc directly from the command line as per this MSDN article.
If you have a dll in there, it might be worth looking inside with a decompiler (either Reflector or Jetbrains DotPeek, which is free) to verify that the SPTasks.master.cs
class is there.
Another thing to check is that the application pool that the site is running under is configured as .Net Framework Version 2.0 and not 4.0
Upvotes: 1
Reputation: 155045
Your IIS website is probably misconfigured. An IIS "virtual directory" is not the same thing as an application scope.
In IIS Manager, right-click the root of your application and choose "Convert to Application".
Upvotes: 0