locked
problem after hosting application RRS feed

  • Question

  • User-532093159 posted

    Hi all, 

    I have been working on this for a few days now but I cant seem to get it to work I have created a web application using C# and ASP.NET MVC4 (using mobile template). My web application works fine when I run it in Visual Studio. I also published it to IIS Default Web Site on localhost and that worked too. But after I deploy it online to my host and when I open the site in the browser then the homepage loads, but if I click the links to go to any other page then I get this error:

    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    I searched online for a solution, this seems to be a common error. I have tried all the solutions that I have come across (like setting all the references to Copy local = true )but I still keep getting the same error above. 

    Can anyone pleas help? Many thanks

    Thursday, April 11, 2013 10:58 AM

Answers

  • User1124521738 posted

    since your code works in both VS and localhost IIS, I wonder if it is a trust issue on your webhoster. While Reflection is possible under Medium trust (the typical shared hosting trust level) some parts are disabled and can trigger errors. Usually you will get something about code security, rather than just a nondescript error, but this might put you on a trail to find the culprit.

    http://www.4guysfromrolla.com/articles/100307-1.aspx

    other thing to verify is that your webhoster has the right .Net framework tied to your webroot, you are using 4.0, they may have it assigned to 2.0...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 21, 2013 12:54 PM
  • User1196771204 posted

    hi jon,

    the issue clearly is on the trust level set on your server. I believe that your server does not support full trust level mode and hence, you need to look for a host that supports full trust mode. You can consider asphostcentral.com for hosting that supports full trust mode.

    Hope this helps.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 12:05 AM

All replies

  • User-718146471 posted

    You may have already done this but on the host check the binary folder to see if all your DLL files are present. If not, I would FTP up a copy of all of them from your local project.

    Thursday, April 11, 2013 11:02 AM
  • User-532093159 posted

    Yes thanks, I just double checked. They are all present.

    Thursday, April 11, 2013 11:07 AM
  • User-532093159 posted

    Also, just to add - I can confirm that the host and database are working fine becuase I created a dummy app and I was successfully able to view it and add data to my database.

    Thursday, April 11, 2013 11:12 AM
  • User-166373564 posted

    Hi archie

    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    It seems that this is similar to a known issue in Microsoft connect,

    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information

    hope it helps you,

    With regards

    Thursday, April 18, 2013 2:44 AM
  • User228685309 posted

    After hosting my website, I had some configuration issues.

    Warning: require_once (Zend/application.php) [function.require-once]: failed to open stream: No such file or directory in //www/***.com/public/index.php on line 22

    I placed the Zend Framewotk library in www/library

    www/application/ www/library/ <--- Zend Framework www/public/

    but after the addition of library another problem occurs:

    HTTP Error 500 (Internal Server Error): An unexpected condition has occurred while the server was attempting to fulfill the request.

    Script of public/index.php

    <?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); defined('TMP_PATH') || define('TMP_PATH', realpath(APPLICATION_PATH . '/../tmp/')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), APPLICATION_PATH . '/models', APPLICATION_PATH . '/models/generated', get_include_path(), ))); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap() ->run(); 

    $application->bootstrap()->run(); does nothing ComebackCheck This

    Sunday, April 21, 2013 12:43 PM
  • User1124521738 posted

    since your code works in both VS and localhost IIS, I wonder if it is a trust issue on your webhoster. While Reflection is possible under Medium trust (the typical shared hosting trust level) some parts are disabled and can trigger errors. Usually you will get something about code security, rather than just a nondescript error, but this might put you on a trail to find the culprit.

    http://www.4guysfromrolla.com/articles/100307-1.aspx

    other thing to verify is that your webhoster has the right .Net framework tied to your webroot, you are using 4.0, they may have it assigned to 2.0...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 21, 2013 12:54 PM
  • User1196771204 posted

    hi jon,

    the issue clearly is on the trust level set on your server. I believe that your server does not support full trust level mode and hence, you need to look for a host that supports full trust mode. You can consider asphostcentral.com for hosting that supports full trust mode.

    Hope this helps.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 12:05 AM