Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Keith Bamberger 26 posts 106 karma points
    Jan 20, 2011 @ 18:39
    Keith Bamberger
    0

    /base - adding class file to App_Code not working? What gives?

    Hi all,

    I have read on various pages that you can now extend Rest without having to manipulate the config file. So excitedly i created my class file with a test and dropped it into the App_Code folder and added some test code.

    for example :

    1. [RestExtension("myAlias")]
    2. public class Test
    3. {
    4. [RestExtensionMethod]
    5. public static string HelloWorld()
    6. {
    7. return "Hello world";
    8. }
    9. [RestExtensionMethod(allowAll=false , allowGroup="custom")]
    10. public static string AnotherWithPermissions()
    11. {
    12. return "Hello member in custom group";
    13. }
    14.  
    15. }

    I fully understand the concept and all should work without having to create a dll if im just dropping my file into the app_code folder but nothing?

    I have taken care to make sure my url is the right case (as i have read a bunch of places its case sensitive), but nothing.

    So the question is.. whats missing? I am of course referencing umbraco and the base in the class file but i feel like im missing something, perhaps a web.config setting?

    I am using umbraco 4.6.1 so i know its the correct version.

    Anyone using this method of extending rest? Without compiling code and adding a dll to the bin folder?

    Thanks for any help

    /Keith

     

     

  • Keith Bamberger 26 posts 106 karma points
    Jan 25, 2011 @ 10:06
    Keith Bamberger
    0

    thought i would add some trace info now to see if i get any help :

    Thread information:

    Thread ID: 52

    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Is impersonating: False

    Stack trace: at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)

    at System.Reflection.Assembly.GetTypes()

    at umbraco.BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(Type attribute)

    at umbraco.presentation.umbracobase.restExtension..ctor(String extensionAlias, String methodName)

    at umbraco.presentation.umbracobase.requestModule.httpApp_PostAcquireRequestState(Object sender, EventArgs e)

    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     

     

  • Janne Mårtensgård 11 posts 232 karma points
    Jan 31, 2011 @ 11:51
    Janne Mårtensgård
    0

    For people running into this problem, we resolved it by installing MVC 3 on the server and adding a few lines to the web.config as per the instructions here: http://our.umbraco.org/projects/website-utilities/xsltsearch/xsltsearch-bugs/16139-Error-when-saving-XSLT-file-in-Umbraco-46-beta?p=4

Please Sign in or register to post replies

Write your reply to:

Draft