http://www.othersite.com/othersite works but not http://www.othersite.com/ - Could not load type 'ot

Discussion in 'Domain names / DNS' started by Senor Engineer, Mar 4, 2015.

  1. Any help is greatly appreciated. I'm having this issue since yesterday and i need to resolve the issue to get the site up and running today.


    I successfully pointed second domain (www.othersite.com) name to subdirectory.

    I deployed the code same way I do with root site, and my othersite works fine locally and also http://www.othersite.com/othersite

    Just wondering why it's not working directly http://www.othersite.com/, any idea? URL Rewrite via IIS Manager seems to be working.

    I did the URL Rewrite same way from http://weblogs.asp.net/owscott/iis-url-rewrite-hosting-multiple-domains-under-one-site and http://weblogs.asp.net/owscott/url-rewrite-multiple-domains-under-one-site-part-ii, so it should be alright I guess.

    I see the error on Default.aspx, so it landed on correct page. Should I copy any assemblies from Subdirectory bin to main directory bin ? This is Visual Studio 2013 C# application, wonder what would I be missing as http://www.othersite.com/othersite works fine but not http://www.othersite.com/ giving below error.

    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 'othersite._Default'.

    Source Error:

    Line 1: <%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_4ltrdomains._Default" %>
    Line 2:
    Line 3: <html lang="en">
     
  2. I was referring to some article that there ca be an issue with inheriting child applications, so I put the below code for both parent and child application web.configs, still this didn't resolve my issue. Please show some light here, thanks.

    <location path="." inheritInChildApplications="false">
    <system.web>
    ..
    </system.web>
    </location path>

    also I did the below, but no luck

    <location path="." inheritInChildApplications="false">
    <system.webserver>
    ..
    </system.webserver>
    </location path>
     
  3. Have you tried also uploading the DLL files in the Bin folder on the root as well?
     
  4. martino

    martino DiscountASP.NET Staff

  5. Raymondp,

    I haven't. So should I copy all the files from subfolder Bin to main site Bin ? (by not overriding the files that are already there) ? I can try and see if that helps.
     
  6. martino,
    I will read your article and try that as well and provide the feedback.
     
  7. Both of above that I tried giving me hard time.

    raymonddp,
    can you elaborate please? From subfolder bin, I copied all and place in main site rootfolder bin (did not override the files that exist), that did not help. Any idea?

    martino,
    sorry, I tried everything there, mine is not MVC application, the problem is the site loads perfectly with http://www.othersite.com/othersite, but http://www.othersite.com/ is throwing error not loading type as I described above (this is subfolder of main site root (web application inside application).
     
  8. FrankC

    FrankC DiscountASP.NET Staff

    can you post or PM me the exact URL? It hard to troubleshoot when we can't see the problem.
     
  9. How do I PM you? IS this where I should send URL ? Please advise so we can resolve. I have many websites to be added to DiscountASP.net, and I've hard time for the last three days. I can even provide you my phone number to talk real quick.

    http://community.discountasp.net/conversations/add?to=FrankC
     
  10. FrankC

    FrankC DiscountASP.NET Staff

    Got your PM. where did you put your rewrite rule? I don't see it in the root web.config
     
  11. If you want any further information, please let me know.
     
    Last edited: Mar 5, 2015
  12. FrankC

    FrankC DiscountASP.NET Staff

    If you followed this post, you should have some rewrite rules in your web.config and I don't see it.

    What's in your global.asax and default.aspx code file? Can you post it?
     
  13. Default.aspx is the page where I have the code (as it's called first) when http://www.xxxx.com/xxx/ is been shown. On global.asax, I'm routing the page to /xxx/default.aspx (I tried other file name it didn't work). If you want more info I can provide you. I can't upload the files though.

    This is for subfolder :

    Default.aspx:

    <%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Domain._Default" %>

    Default.aspx.cs :

    namespace Domain
    {
    public partial class _Default : Page
    {

    Global.asax:

    <%@ Application Codebehind="Global.asax.cs" Inherits="Domain.Global" Language="C#" %>

    Global.asax.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Optimization;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.SessionState;

    namespace Domain
    {
    public class Global : HttpApplication
    {
    void Application_Start(object sender, EventArgs e)
    {
    // Code that runs on application startup
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
    }
    }
     
    Last edited: Mar 5, 2015
  14. FrankC

    FrankC DiscountASP.NET Staff

    This is so weird. Do you mind give me the VS.NET project so I can test it in my account?
     
  15. I'm sorry, very little help here. Finally I could work without after hard-fighting four days and got it work.

    When I apply the rules directly on URL Rewrite using IIS Manager, it works. When I deploy the latest code again the URL Rewrite rules are gone. If there is anything that you can help, you can provide me hint. I know you may not check forums frequently.
     
  16. FrankC

    FrankC DiscountASP.NET Staff

    ok.. i see..

    Whenever you make a configuration with IIS Manager, it writes it to the web.config file.

    You should do the following:

    • Create the rule with IIS Manager
    • Download the web.config (depending on where you put the URLRewrite rule; it should be your web.config)
    • Add the URL Rewrite rule to your local web.config.
     
  17. Thanks, it worked, the instructructions doesn't have to take Web.Config code for URLRewrite from webserver and update in source. It would save time in troubleshooting.
     

Share This Page