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?
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.
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.
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?
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:
Just take a look at the download section of codeplex where you have several resources how to use umbraco with 3.5
Thomas
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.
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.
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; }
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.
If you are using vista => IIS 7 take a look at the codedom section :
Also you can look if you are missing some references in the compilation section:
hth,
Thomas
Looks like you just have a bit of a mistake in your code. Have a look at this MSDN article, it might help!
is working on a reply...
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.