Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

DotNet 3.5
mjmilan
#1 Posted : Wednesday, April 15, 2009 2:59:58 AM(UTC)
Groups: Member
Joined: 4/15/2009(UTC)
Posts: 5
Location: York, United Kingdom

Hi,

Before we get started, my thanks to the UltiDev team for what is a very impressive offering - I'm using Cassini as I try to learn ASP.Net, and I think it's great... I'm certainly making my colleagues (I work in an Application development team) aware of it!

I'm working with SharpDevelop and Cassini, and writing a little app for internal consumption on my employer's LAN. One of my pages however keeps falling over because I have of a problem with how I have defined some properties on a user control...

Basically, I've taken advantage of a more concise way of declaring properties in C#, and declared a number of properties on my usercontrol as follows:

public string BeginParen{get; set;}
public string EndParen{get; set;}
public string OriginalText{get; set;}
public string TextDelimiter{get; set;}

When I view a page using this user control, the page crashes, and I get the exception detailed below in red...

Now, SharpDevelop is happy to compile the class (which tells me SharpDevelop is compiling as 3.5), but the error below would seem to suggest that Cassini is using the 2005 framework to compile the class when servicing the page request...

Simple questions then really - is this merely a config I've missed when setting up Cassini?

If not, and cassini always uses the 2005 compiler, can I still use 3.5 features like LINQ?

Martin.

Ps. In the mean time, I'm going to continue to use this great little server by simply writing my property declarations 2005 style...


Cheers!

Server Error in '/' Application.


Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0501: 'UtilSite.Parens.UCParenParser.BeginParen.get' must declare a body because it is not marked abstract or extern

Source Error:



Line 53: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 54: #region Properties
Line 55: public string BeginParen{get; set;}
Line 56: public string EndParen{get; set;}
Line 57: public string OriginalText{get; set;}


Source File: c:\Sandbox\UtilSite\Parens\UCParenParser.cs Line: 55



Show Detailed Compiler Output:


C:\Program Files\UltiDev\Cassini Web Server for ASP.NET 2.0> "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\05b03259\90f9b50d\assembly\dl3\fb618b84\97658af7_bdbdc901\UtilSite.DLL" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\05b03259\90f9b50d\App_global.asax.jmexqwmm.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /out:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\05b03259\90f9b50d\App_Web_ucparenparser.cs.3c4ece8c.mrhwhuol.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\05b03259\90f9b50d\App_Web_ucparenparser.cs.3c4ece8c.mrhwhuol.0.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\05b03259\90f9b50d\App_Web_ucparenparser.cs.3c4ece8c.mrhwhuol.1.cs"


Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

c:\Sandbox\UtilSite\Parens\UCParenParser.cs(55,28): error CS0501: 'UtilSite.Parens.UCParenParser.BeginParen.get' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(55,33): error CS0501: 'UtilSite.Parens.UCParenParser.BeginParen.set' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(56,26): error CS0501: 'UtilSite.Parens.UCParenParser.EndParen.get' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(56,31): error CS0501: 'UtilSite.Parens.UCParenParser.EndParen.set' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(57,30): error CS0501: 'UtilSite.Parens.UCParenParser.OriginalText.get' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(57,35): error CS0501: 'UtilSite.Parens.UCParenParser.OriginalText.set' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(58,31): error CS0501: 'UtilSite.Parens.UCParenParser.TextDelimiter.get' must declare a body because it is not marked abstract or extern
c:\Sandbox\UtilSite\Parens\UCParenParser.cs(58,36): error CS0501: 'UtilSite.Parens.UCParenParser.TextDelimiter.set' must declare a body because it is not marked abstract or extern





Show Complete Compilation Source:


Line 1: /*
Line 2: * Created by SharpDevelop.
Line 3: * User: martin.milan
Line 4: * Date: 14/04/2009
Line 5: * Time: 16:47
Line 6: *
Line 7: * To change this template use Tools | Options | Coding | Edit Standard Headers.
Line 8: */
Line 9: using System;
Line 10: using System.Web;
Line 11: using System.Web.SessionState;
Line 12: using System.Web.UI;
Line 13: using System.Web.UI.WebControls;
Line 14: using System.Web.UI.HtmlControls;
Line 15:
Line 16: namespace UtilSite.Parens
Line 17: {
Line 18: /// <summary>
Line 19: /// Description of UCParenParser
Line 20: /// </summary>
Line 21: public class UCParenParser : Control
Line 22: {
Line 23: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 24: #region Data
Line 25:
Line 26: #endregion
Line 27: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 28: #region Constructor
Line 29:
Line 30: public UCParenParser()
Line 31: {
Line 32: Init += new EventHandler( OnInit );
Line 33: Load += new EventHandler( OnLoad );
Line 34: }
Line 35:
Line 36: #endregion
Line 37: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 38: #region OnInit
Line 39:
Line 40: private void OnInit(object sender, EventArgs e)
Line 41: {
Line 42: }
Line 43:
Line 44: #endregion
Line 45: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 46: #region OnLoad
Line 47:
Line 48: private void OnLoad(object sender, EventArgs e)
Line 49: {
Line 50: }
Line 51:
Line 52: #endregion
Line 53: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 54: #region Properties
Line 55: public string BeginParen{get; set;}
Line 56: public string EndParen{get; set;}
Line 57: public string OriginalText{get; set;}
Line 58: public string TextDelimiter{get; set;}
Line 59: #endregion
Line 60: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Line 61: #region Render
Line 62:
Line 63: protected override void Render(HtmlTextWriter Writer)
Line 64: {
Line 65: Writer.Write( this.OriginalText + "Hello" );
Line 66: }
Line 67: #endregion
Line 68: }
Line 69: }
Line 70:






Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Ultidev Team
#2 Posted : Wednesday, April 15, 2009 7:50:26 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Martin.

Thank you very much for using UltiDev Cassini and for such a great feedback.

Property declaration without actually implementing get/set accessors is valid in .NET 2.0 and they indicate that the class containing them is supposed to be abstract. This means that SharpDevelop may still be compiling your site as ASP.NET 2.0.

Since we don't use SharpDevelop in-house, we conducted a small experiment of creating a web site in VS 2005/.NET 2.0, and then converting it into ASP.NET 3.5. We found that the only change that occurred when we used Visual Studio 2008 to convert the site was a heavy modification to the web.config file.

To test whether the web site will be working in UltiDev Cassini after conversion to 3.5, we used C# 3.0 feature called lambda-expression along with TimeZoneInfo class introduced in Framework 3.5 and not present in 2.0. It worked like a charm, so we are pretty confident that if you use JIT compilation - as in case with Cassini and Web Site project type, you simply need proper settings in web.config. If SharpDevelop allows to specify target framework version and pre-compile the solution, like Web Application project type (which is different from Web Site type), then you need to adjust both web.config and SharpDevelop settings.

Below are three files that comprise our simple 3.5 web site that ran under Cassini successfully:

Default.aspx
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>


Default.aspx.cs
Code:
using System;
using System.Web;
using System.Web.UI;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Button1.Click += (s, e1) =>
{
Label1.Text = string.Format("{0} in {1}",
DateTime.Now, TimeZoneInfo.Local.DisplayName);
};
}
}


Web.config
Code:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<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"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mjmilan
#3 Posted : Sunday, April 19, 2009 10:59:48 PM(UTC)
Groups: Member
Joined: 4/15/2009(UTC)
Posts: 5
Location: York, United Kingdom

Thanks for taking the time to investigate this...

I'm going to investigate the possibility that the assembly produced by SharpDevelop has been produced using the 2005 compiler. Primarily I work as a Windows Application developer, and I have encountered a similar issue using SharpDevelop with WinForms in the past. I dismissed it in this case because I didn't think the {get; set;} was legal in 2005 - so thanks for the correction on that...

I think I'm going to install FileMon, run the compilation again, and see which compiler is being used.

Once again, thanks for your help and support. You've far exceeded my expectations.

Martin.
Ultidev Team
#4 Posted : Monday, April 20, 2009 8:52:23 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Not a problem, Martin. We are always glad to help.
Once you figure out what is going on, could you please share the information by posting it in this forum? It will be greatly appreciated.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mjmilan
#5 Posted : Wednesday, April 22, 2009 3:02:56 AM(UTC)
Groups: Member
Joined: 4/15/2009(UTC)
Posts: 5
Location: York, United Kingdom

I'll certainly do that...

Running process monitor didn't actually tell me a whole lot when SharpDevelop was compiling the web application - I did get some reports of it looking for 3.5 stuff and not finding it, but no reports of it actually using the 2.0 stuff...

I will keep looking, and will post details when I have them.

Martin.
Ultidev Team
#6 Posted : Wednesday, April 22, 2009 6:08:56 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Thank you, Martin.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.