Copied to clipboard

Flag this post as spam?

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


  • Sajid Riaz 142 posts 165 karma points
    Sep 04, 2010 @ 01:53
    Sajid Riaz
    0

    .net user control in umbraco version 4.5

    Hi everyone,

    I'm having problems getting a user control working.

    here's what I'm doing:

    I'm creating a web application in VS 2008, in the web app I'm adding a web user control.  I build the project and then copy the dll to umbraco bin folder, the ascx and the  ascx.vb to the usercontrols folder in umbraco.

    when view my site I see:

    Error creating control (usercontrols/SRContactForm.ascx).
    Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!

    Stack Trace shows:


    Error creating usercontrol (usercontrols/SRContactForm.ascx)
    InternalXmlHelper.vb(9): error BC30560: 'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'.
      at System.Web.Compilation.AssemblyBuilder.Compile()
      at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
      at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
      at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
      at umbraco.macro.loadUserControl(String fileName, Hashtable attributes, Hashtable pageElements)
  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 06, 2010 @ 09:40
    Richard Soeteman
    0

    Hi,

    The error is because the .Net compiler can't detect the type of ExtensionAttribute in your InternalXmlHelper class. If you specify the type including the namsepaces it should work.

    Cheers,

    Richard

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 10:21
    Sajid Riaz
    0

    Hi Richard thanks for your reply,

    I haven't added ExtensionAttribute in the InternalXmlHelper class.  I get this error version umb 4.5.1.

    I get same error in umb 4.5.2 until i change app pool to .net 2 integrated.


  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 06, 2010 @ 10:53
    Matt Brailsford
    0

    Hi Sajid,

    What version of .NET are you compiling your web application against? And what compiled version of Umbraco 4.5.x are you using? (.NET 3.5 or .NET 4.0)

    You may have an issue with using extension methods compiled in different version of .NET

    Have a look at this article for details.

    http://www.thesoftwaredevotional.com/2009/01/warning-about-using-extension-methods.html

    Matt

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 11:35
    Sajid Riaz
    0

    Hi Matt, thanks for yr reply.

    I believe I'm using the UMB 4.5.1.  I installed this version manually about a month ago.  web.config has references to version 4.  So I think I'm using version 4 as the app pool is set to .net 4 integrated.

    the problem arises when i add a user control created in VS 2008. I get the error I listed above.

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 06, 2010 @ 11:40
    Matt Brailsford
    0

    And are you targeting .NET 4 in VS 2008? I'm guessing not as you mentioned it worked when you switched to .NET 2 in your app pool.

    The problem is your dll's are working with different versions of .NET, so you've got conflicts. I'd say you wither need to target .NET 4 in your VS project (I'm not sure if that's possible in VS 2008) or try using the .NET 3.5 build of Umbraco.

    Matt

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 11:57
    Sajid Riaz
    0

    Hi Matt,

    I was creating a user control vs2008 and uploading the ascx and the dll to umb 4.5.1.  this gave the error.

    (i manually uploaded umb 4.5.1 to my host .net 4 version)

    I just created the same usercontrol in vs2010 and uploaded to 4.5.1, same error

    I created the usercontrol as a web app and copied the dll to umb bin folder and the ascx to umb user controls folder.

     

    I am missing something or doing something incorrectly?

     

     

  • skiltz 501 posts 701 karma points
    Sep 06, 2010 @ 12:02
    skiltz
    0

    Wasn't there some kind of problem with creating VB.net user controls in 4.5.1??? Will try and find linky...

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 12:05
    Sajid Riaz
    0

    skiltz,

     ahhh i hope thats the case as I'm pulling my hair out trying to get it working.

    awaiting yr reply.

  • skiltz 501 posts 701 karma points
    Sep 06, 2010 @ 12:05
  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 12:10
    Sajid Riaz
    0

    So in essence I cannot add the user control to umb 4.5.1? Is that right?

    If I wanted to upgrade 4.5.1 to 4.5.2 is that a painful thing to do?

  • skiltz 501 posts 701 karma points
    Sep 06, 2010 @ 12:13
    skiltz
    0

    Correct, not painfull at all.  Copy over bin, umbraco, umbraco_client, install directories.  Make sure take filesystem and db backup first.  4.5.2 is a lot better than 4.5.1 so this should be done anyway.

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 12:26
    Sajid Riaz
    0

    Skiltz,  Thankyou.

     

    So what I will do is get the web platform installer 3 and download umbraco 4.5.2 .net 4 version on my local host.

    and ftp the directories you mention above to my web site, is this right?

    Just to confirm the directories that need to be replaced:

    bin

    install

    umbraco

    umbraco_client

     

     

  • skiltz 501 posts 701 karma points
    Sep 06, 2010 @ 12:31
  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 12:40
    Sajid Riaz
    0

    Wow, lets hop I can do it Correctly 

    ok will do it and let you know if succeed.

    so in total i need to replace the following folders / files:

    • /app_data
    • /app_browsers
    • /app_code
    • /bin
    • /config
    • /data
    • /install
    • /umbraco
    • /umbraco_client
    • web.config
    • default.aspx
    after i've copied the files how do I run the umbraco installer to upgrade the Database?

  • Sajid Riaz 142 posts 165 karma points
    Sep 06, 2010 @ 17:00
    Sajid Riaz
    0

    Hi I downloaded the latest umb 4.5.2 from codeplex.

    and copied over to my website the files/folders mentioned above.

    when i run the umbracoinstaller, it ran successfully but indicated my db was uptodate, is that correct?

    anyway..same error with user control appears.

     

    any ideas?

    thanks in advance

  • Sajid Riaz 142 posts 165 karma points
    Sep 07, 2010 @ 14:05
    Sajid Riaz
    0

    The upgrade didn't worked fine. But the user control was still giving error.  

    So ended up downloading the 4.5.2 and re-doing the website. all is ok now.

    Sajid

  • Thomas.R 39 posts 62 karma points
    Sep 07, 2010 @ 14:12
    Thomas.R
    0

    I have the exactly same problem since umb 4.01.

    This issue has already been reported : http://our.umbraco.org/forum/using/ui-questions/11217-ExtensionAttribute-is-ambiguous-Why-is-it-not-getting-attention?p=0#comment46136

    Unlike said on codeplex it is not fixed, i updated my umbraco installation to 4.5.2 and i still get this error, is there a special trick to do after this ?

  • Sajid Riaz 142 posts 165 karma points
    Sep 08, 2010 @ 00:21
    Sajid Riaz
    0

    Hey Thomas,

    I was trying to add a contact form ctl to a site up and running, in the end even after an upgrade it didn't work. so i didn't go ahead with it,

    but just to satisfy my selfy i created a website on my local host.  i downloaded umbraco 4.5.2 using web platform installer 3 (beta) to get the .net 4 version.

    when i added the user control (which simply out put "Hello World") it seemed to render the message correctly.

    but thats all i did.

     

Please Sign in or register to post replies

Write your reply to:

Draft