Copied to clipboard

Flag this post as spam?

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


  • Robert J. Bullock 386 posts 404 karma points
    Aug 06, 2009 @ 16:35
    Robert J. Bullock
    0

    Web User Controls on Vista

    It appears to me that when trying to use create a web User Control macro and browse the properties in Umbraco, Umbraco is utilzing .net 2.0 to compile the user control... so I can't use C# 3.0 features. I think this is specific to Vista. Anyone know how to force Vista to comiple with 3.5 framework by default?

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 06, 2009 @ 16:40
    Thomas Höhler
    0

    Take a look into the web.config. There you can see which versions you are using. eg.: We are using 3.5 so you can see the first section like this:

     <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
    </sectionGroup>
    </sectionGroup>
    </sectionGroup>

    Just take a look at the download section of codeplex where you have several resources how to use umbraco with 3.5

    Thomas

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 06, 2009 @ 17:13
    Sebastiaan Janssen
    0

    You could quite easily upgrade to .NET 3.5 by dropping this 3.5 config file in your root folder (name it web.config obviously).

    I had to change the config in IIS, the application pool needs to run in pipeline mode.

    When you change to the new config file, the umbraco set-up will run again, but after that your site is completely ready to use in 3.5 mode.

  • Robert J. Bullock 386 posts 404 karma points
    Aug 06, 2009 @ 17:52
    Robert J. Bullock
    0

    Okay, I upgraded my web.config, but I'm still getting this error trying to access public properties in my web user control:

    System.Web.HttpCompileException: c:\inetpub\sites\scschools\usercontrols\google_directions.ascx.cs(9): error CS0501: 'scschools_google_directions.width.get' must declare a body because it is not marked abstract, extern, or partial 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) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)

    See what I mean? It's not allowing for "C# 3.0 style" default accessors.

     


  • Robert J. Bullock 386 posts 404 karma points
    Aug 06, 2009 @ 17:54
    Robert J. Bullock
    0

    I should mention that this approach works in other projects/user controls... I'm referring to this:

     

       public string NodeIdQryString { get; set; }

        public string PageTitleProperty { get; set; }

        public string ViewPageURL { get; set; }

        public string EmailSubject { get; set; }

        public string DefaultMessage { get; set; }

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 06, 2009 @ 18:39
    Morten Bock
    0

    Looks like it a build time thing. Are you compiling you user controls to a dll, or at you using the raw .cs files in the website?

    The property thing you mention should be purely C# language specific, and should not matter if you compile it. But your website/server may not have the correct setup for building 3.5 code.

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 06, 2009 @ 19:44
    Thomas Höhler
    0

    If you are using vista => IIS 7 take a look at the codedom section :

     <system.codedom>
    <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
    type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/>
    </compiler>
    </compilers>
    </system.codedom>

    Also you can look if you are missing some references in the compilation section:

     <compilation defaultLanguage="c#" batch="false" debug="false">
    <assemblies>
    <!-- ASPNETAJAX -->
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

    hth,

    Thomas

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 06, 2009 @ 22:08
    Sebastiaan Janssen
    0

    Looks like you just have a bit of a mistake in your code. Have a look at this MSDN article, it might help!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies