C#: Compiling Classes Independently - How?

View: New views
14 Messages — Rating Filter:   Alert me  

C#: Compiling Classes Independently - How?

by G_Morgan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Simply put I always develop my code in C++ by compiling each file into a separate object code file and then linking them together. In C# I'm struggling to see how to do this or anything similar. I've tried using assemblies and modules but both require me to actually deliver the assembly or module with the executable. Does a mechanism exist by which a module can be copied directly into the executable image and thus let me delete the .netmodule files and still run? If not is there a sensible CLI mechanism to allow C# programs to be developed in such a way that I'm not doing a complete rebuild with every minor change?

I've tried using the incremental flag but smcs seems to throw a fit complaining about missing .netmodule files. The description of the option in the MSDN documents doesn't suggest that these files are needed.

Re: C#: Compiling Classes Independently - How?

by Charlie Poole :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I remember being equally surprised when I moved from C++
to C#. What you describe is how C++ works, but not how C# works.

In the long run, I think you'll be much more satisfied with
the results if you learn to adapt to this new environment.

There are, of course, ways to simulate your C++ experience
using modules, but you will be creating a terribly complicated
structure and anyone who follows you on the job will not
be thankful. :-)

If you have real performance problems with your compiles, it
may mean that you are putting too much into a single assembly.
It's pretty normal for an application developed in C# to have
multiple assemblies, which are all delivered in the same
directory.

I suggest you try to go with the flow for a few weeks and
then decide whether you really need to simulate your old
environment.

Charlie


> -----Original Message-----
> From: mono-list-bounces@...
> [mailto:mono-list-bounces@...] On Behalf Of G_Morgan
> Sent: Monday, June 29, 2009 11:51 AM
> To: mono-list@...
> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>
>
> Simply put I always develop my code in C++ by compiling each
> file into a separate object code file and then linking them
> together. In C# I'm struggling to see how to do this or
> anything similar. I've tried using assemblies and modules but
> both require me to actually deliver the assembly or module
> with the executable. Does a mechanism exist by which a module
> can be copied directly into the executable image and thus let
> me delete the .netmodule files and still run? If not is there
> a sensible CLI mechanism to allow C# programs to be developed
> in such a way that I'm not doing a complete rebuild with
> every minor change?
>
> I've tried using the incremental flag but smcs seems to throw
> a fit complaining about missing .netmodule files. The
> description of the option in the MSDN documents doesn't
> suggest that these files are needed.
> --
> View this message in context:
> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
> How--tp24259351p24259351.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@...
> http://lists.ximian.com/mailman/listinfo/mono-list
>



_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: C#: Compiling Classes Independently - How?

by David Rivera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would really follow Charlie's advice, go with it for a while.  I have a project I work on that has 3500+ separate classes, and it only takes about 25 seconds to do a compile on the entire tree.  That is one of C#/.NET's advantages, very efficient compile times compared to C/C++.

-Dave Rivera

Charlie Poole wrote:
Hi,

I remember being equally surprised when I moved from C++
to C#. What you describe is how C++ works, but not how C# works.

In the long run, I think you'll be much more satisfied with
the results if you learn to adapt to this new environment.

There are, of course, ways to simulate your C++ experience
using modules, but you will be creating a terribly complicated
structure and anyone who follows you on the job will not
be thankful. :-)

If you have real performance problems with your compiles, it
may mean that you are putting too much into a single assembly.
It's pretty normal for an application developed in C# to have
multiple assemblies, which are all delivered in the same
directory.

I suggest you try to go with the flow for a few weeks and
then decide whether you really need to simulate your old
environment.

Charlie


> -----Original Message-----
> From: mono-list-bounces@lists.ximian.com
> [mailto:mono-list-bounces@lists.ximian.com] On Behalf Of G_Morgan
> Sent: Monday, June 29, 2009 11:51 AM
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>
>
> Simply put I always develop my code in C++ by compiling each
> file into a separate object code file and then linking them
> together. In C# I'm struggling to see how to do this or
> anything similar. I've tried using assemblies and modules but
> both require me to actually deliver the assembly or module
> with the executable. Does a mechanism exist by which a module
> can be copied directly into the executable image and thus let
> me delete the .netmodule files and still run? If not is there
> a sensible CLI mechanism to allow C# programs to be developed
> in such a way that I'm not doing a complete rebuild with
> every minor change?
>
> I've tried using the incremental flag but smcs seems to throw
> a fit complaining about missing .netmodule files. The
> description of the option in the MSDN documents doesn't
> suggest that these files are needed.
> --
> View this message in context:
> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
> How--tp24259351p24259351.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Re: C#: Compiling Classes Independently - How?

by G_Morgan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So the official advice is to shut up and deal with it ;). I think I can understand why MS decided to do things this way. Something along the line of 'OMG look at all those class files everywhere' wrt Java. Why don't they both understand that C got it right in times immemorial? That you should copy exactly and never question the one true way!

Out of interest are there any build tools that manage Mono projects in a sane manner or do they all face the same problem I've bumped into trying to use make?

Charlie Poole wrote:
Hi,

I remember being equally surprised when I moved from C++
to C#. What you describe is how C++ works, but not how C# works.

In the long run, I think you'll be much more satisfied with
the results if you learn to adapt to this new environment.

There are, of course, ways to simulate your C++ experience
using modules, but you will be creating a terribly complicated
structure and anyone who follows you on the job will not
be thankful. :-)

If you have real performance problems with your compiles, it
may mean that you are putting too much into a single assembly.
It's pretty normal for an application developed in C# to have
multiple assemblies, which are all delivered in the same
directory.

I suggest you try to go with the flow for a few weeks and
then decide whether you really need to simulate your old
environment.

Charlie


> -----Original Message-----
> From: mono-list-bounces@lists.ximian.com
> [mailto:mono-list-bounces@lists.ximian.com] On Behalf Of G_Morgan
> Sent: Monday, June 29, 2009 11:51 AM
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>
>
> Simply put I always develop my code in C++ by compiling each
> file into a separate object code file and then linking them
> together. In C# I'm struggling to see how to do this or
> anything similar. I've tried using assemblies and modules but
> both require me to actually deliver the assembly or module
> with the executable. Does a mechanism exist by which a module
> can be copied directly into the executable image and thus let
> me delete the .netmodule files and still run? If not is there
> a sensible CLI mechanism to allow C# programs to be developed
> in such a way that I'm not doing a complete rebuild with
> every minor change?
>
> I've tried using the incremental flag but smcs seems to throw
> a fit complaining about missing .netmodule files. The
> description of the option in the MSDN documents doesn't
> suggest that these files are needed.
> --
> View this message in context:
> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
> How--tp24259351p24259351.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Re: C#: Compiling Classes Independently - How?

by Maser, Dan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

  I wouldn't be too surprised if your rude behavior fails to inspire anyone to help you get your question answered.  

  Charlie Poole, thanks for taking the time you ovbiously took with your reply.

-----Original Message-----
From: mono-list-bounces@... [mailto:mono-list-bounces@...] On Behalf Of G_Morgan
Sent: Monday, June 29, 2009 4:03 PM
To: mono-list@...
Subject: Re: [Mono-list] C#: Compiling Classes Independently - How?


So the official advice is to shut up and deal with it ;). I think I can
understand why MS decided to do things this way. Something along the line of
'OMG look at all those class files everywhere' wrt Java. Why don't they both
understand that C got it right in times immemorial? That you should copy
exactly and never question the one true way!

Out of interest are there any build tools that manage Mono projects in a
sane manner or do they all face the same problem I've bumped into trying to
use make?


Charlie Poole wrote:

>
> Hi,
>
> I remember being equally surprised when I moved from C++
> to C#. What you describe is how C++ works, but not how C# works.
>
> In the long run, I think you'll be much more satisfied with
> the results if you learn to adapt to this new environment.
>
> There are, of course, ways to simulate your C++ experience
> using modules, but you will be creating a terribly complicated
> structure and anyone who follows you on the job will not
> be thankful. :-)
>
> If you have real performance problems with your compiles, it
> may mean that you are putting too much into a single assembly.
> It's pretty normal for an application developed in C# to have
> multiple assemblies, which are all delivered in the same
> directory.
>
> I suggest you try to go with the flow for a few weeks and
> then decide whether you really need to simulate your old
> environment.
>
> Charlie
>
>
>> -----Original Message-----
>> From: mono-list-bounces@...
>> [mailto:mono-list-bounces@...] On Behalf Of G_Morgan
>> Sent: Monday, June 29, 2009 11:51 AM
>> To: mono-list@...
>> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>>
>>
>> Simply put I always develop my code in C++ by compiling each
>> file into a separate object code file and then linking them
>> together. In C# I'm struggling to see how to do this or
>> anything similar. I've tried using assemblies and modules but
>> both require me to actually deliver the assembly or module
>> with the executable. Does a mechanism exist by which a module
>> can be copied directly into the executable image and thus let
>> me delete the .netmodule files and still run? If not is there
>> a sensible CLI mechanism to allow C# programs to be developed
>> in such a way that I'm not doing a complete rebuild with
>> every minor change?
>>
>> I've tried using the incremental flag but smcs seems to throw
>> a fit complaining about missing .netmodule files. The
>> description of the option in the MSDN documents doesn't
>> suggest that these files are needed.
>> --
>> View this message in context:
>> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
>> How--tp24259351p24259351.html
>> Sent from the Mono - General mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Mono-list maillist  -  Mono-list@...
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@...
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>

--
View this message in context: http://www.nabble.com/C-%3A-Compiling-Classes-Independently---How--tp24259351p24261591.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: C#: Compiling Classes Independently - How?

by Alan McGovern-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Mon, Jun 29, 2009 at 10:02 PM, G_Morgan <gmorgan1984@...> wrote:

So the official advice is to shut up and deal with it ;). I think I can
understand why MS decided to do things this way. Something along the line of
'OMG look at all those class files everywhere' wrt Java. Why don't they both
understand that C got it right in times immemorial? That you should copy
exactly and never question the one true way!

Out of interest are there any build tools that manage Mono projects in a
sane manner or do they all face the same problem I've bumped into trying to
use make?

The only issue you've mentioned is that you noticed that C# code compiles differently to C code, so I can only assume that this is the problem you're referring to. If so, the solution really isn't "shut up and deal with it", the solution is to realise this isn't a problem. There is a way to simulate the C build process, but it'd make your compile take at least three times longer than normal and would make maintenance of your project such a gigantic pain that you'd revert back to the normal (fast) workflow within days.

As a single datapoint, 35,000 lines of code (excludes whitespace) can compile in under 2.5 seconds using gmcs on my rather modest 1.86ghz laptop with 5400 rpm harddrive. A computer with a faster hd will compile faster I'm sure.

Alan.




Charlie Poole wrote:
>
> Hi,
>
> I remember being equally surprised when I moved from C++
> to C#. What you describe is how C++ works, but not how C# works.
>
> In the long run, I think you'll be much more satisfied with
> the results if you learn to adapt to this new environment.
>
> There are, of course, ways to simulate your C++ experience
> using modules, but you will be creating a terribly complicated
> structure and anyone who follows you on the job will not
> be thankful. :-)
>
> If you have real performance problems with your compiles, it
> may mean that you are putting too much into a single assembly.
> It's pretty normal for an application developed in C# to have
> multiple assemblies, which are all delivered in the same
> directory.
>
> I suggest you try to go with the flow for a few weeks and
> then decide whether you really need to simulate your old
> environment.
>
> Charlie
>
>
>> -----Original Message-----
>> From: mono-list-bounces@...
>> [mailto:mono-list-bounces@...] On Behalf Of G_Morgan
>> Sent: Monday, June 29, 2009 11:51 AM
>> To: mono-list@...
>> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>>
>>
>> Simply put I always develop my code in C++ by compiling each
>> file into a separate object code file and then linking them
>> together. In C# I'm struggling to see how to do this or
>> anything similar. I've tried using assemblies and modules but
>> both require me to actually deliver the assembly or module
>> with the executable. Does a mechanism exist by which a module
>> can be copied directly into the executable image and thus let
>> me delete the .netmodule files and still run? If not is there
>> a sensible CLI mechanism to allow C# programs to be developed
>> in such a way that I'm not doing a complete rebuild with
>> every minor change?
>>
>> I've tried using the incremental flag but smcs seems to throw
>> a fit complaining about missing .netmodule files. The
>> description of the option in the MSDN documents doesn't
>> suggest that these files are needed.
>> --
>> View this message in context:
>> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
>> How--tp24259351p24259351.html
>> Sent from the Mono - General mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Mono-list maillist  -  Mono-list@...
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@...
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>

--
View this message in context: http://www.nabble.com/C-%3A-Compiling-Classes-Independently---How--tp24259351p24261591.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: C#: Compiling Classes Independently - How?

by G_Morgan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Somebody posted to me privately on this so I'll repeat the jist of what I said there. The first part was meant in jest and not at all meant to be taken seriously. Unfortunately context doesn't come out well over the web. In any case I apologise unreservedly if I upset anyone, it was not my intent.

I echo thanks for the initial reply. It does indeed help to know how things should be done in C#. I anticipated a problem which apparently isn't as relevant in C#.

Maser, Dan wrote:
  I wouldn't be too surprised if your rude behavior fails to inspire anyone to help you get your question answered.  

  Charlie Poole, thanks for taking the time you ovbiously took with your reply.

-----Original Message-----
From: mono-list-bounces@lists.ximian.com [mailto:mono-list-bounces@lists.ximian.com] On Behalf Of G_Morgan
Sent: Monday, June 29, 2009 4:03 PM
To: mono-list@lists.ximian.com
Subject: Re: [Mono-list] C#: Compiling Classes Independently - How?


So the official advice is to shut up and deal with it ;). I think I can
understand why MS decided to do things this way. Something along the line of
'OMG look at all those class files everywhere' wrt Java. Why don't they both
understand that C got it right in times immemorial? That you should copy
exactly and never question the one true way!

Out of interest are there any build tools that manage Mono projects in a
sane manner or do they all face the same problem I've bumped into trying to
use make?


Charlie Poole wrote:
>
> Hi,
>
> I remember being equally surprised when I moved from C++
> to C#. What you describe is how C++ works, but not how C# works.
>
> In the long run, I think you'll be much more satisfied with
> the results if you learn to adapt to this new environment.
>
> There are, of course, ways to simulate your C++ experience
> using modules, but you will be creating a terribly complicated
> structure and anyone who follows you on the job will not
> be thankful. :-)
>
> If you have real performance problems with your compiles, it
> may mean that you are putting too much into a single assembly.
> It's pretty normal for an application developed in C# to have
> multiple assemblies, which are all delivered in the same
> directory.
>
> I suggest you try to go with the flow for a few weeks and
> then decide whether you really need to simulate your old
> environment.
>
> Charlie
>
>
>> -----Original Message-----
>> From: mono-list-bounces@lists.ximian.com
>> [mailto:mono-list-bounces@lists.ximian.com] On Behalf Of G_Morgan
>> Sent: Monday, June 29, 2009 11:51 AM
>> To: mono-list@lists.ximian.com
>> Subject: [Mono-list] C#: Compiling Classes Independently - How?
>>
>>
>> Simply put I always develop my code in C++ by compiling each
>> file into a separate object code file and then linking them
>> together. In C# I'm struggling to see how to do this or
>> anything similar. I've tried using assemblies and modules but
>> both require me to actually deliver the assembly or module
>> with the executable. Does a mechanism exist by which a module
>> can be copied directly into the executable image and thus let
>> me delete the .netmodule files and still run? If not is there
>> a sensible CLI mechanism to allow C# programs to be developed
>> in such a way that I'm not doing a complete rebuild with
>> every minor change?
>>
>> I've tried using the incremental flag but smcs seems to throw
>> a fit complaining about missing .netmodule files. The
>> description of the option in the MSDN documents doesn't
>> suggest that these files are needed.
>> --
>> View this message in context:
>> http://www.nabble.com/C-%3A-Compiling-Classes-Independently---
>> How--tp24259351p24259351.html
>> Sent from the Mono - General mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Mono-list maillist  -  Mono-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>

--
View this message in context: http://www.nabble.com/C-%3A-Compiling-Classes-Independently---How--tp24259351p24261591.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

ASP.Net compilation error with VB and C# and Mono V2.4.2

by jwezel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I've got this error when trying to access my test website and if I've put a file "cammWM.dll" into my bin directory:

Server Error in '/' Application

--------------------------------------------------------------------------------

VBNC_CRASH: Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r) Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
Error : VBNC99999: Unexpected error: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in /usr/src/packages/BUILD/mono-2.4.2/mcs/class/corlib/System.Reflection/Assembly.cs:348 at vbnc.TypeManager.LoadReferencedTypes () [0x00028] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:441 at vbnc.TypeManager.LoadReferenced () [0x000e3] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:306 at vbnc.Compiler.Compile () [0x001e2] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:534
Compilation took 00:00:00.8301500
Description: HTTP 500. Error processing request.

Stack Trace:

System.Web.Compilation.CompilationException: VBNC_CRASH: Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.

Error : VBNC99999: Unexpected error: The classes in the module cannot be loaded.  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in /usr/src/packages/BUILD/mono-2.4.2/mcs/class/corlib/System.Reflection/Assembly.cs:348
  at vbnc.TypeManager.LoadReferencedTypes () [0x00028] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:441
  at vbnc.TypeManager.LoadReferenced () [0x000e3] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:306
  at vbnc.Compiler.Compile () [0x001e2] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:534 Compilation took 00:00:00.8301500

  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000]
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Collections.Generic.List`1 buildItems, System.Web.VirtualPath virtualPath, BuildKind buildKind) [0x00000]
  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.String virtualPath, System.Type requiredBaseType) [0x00000]
  at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000]
  at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000]
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000]
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000]
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x00000]  

--------------------------------------------------------------------------------
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433


Given is the ASPX file with this content:
debopweb02:/srv/_default/htdocs # cat index.aspx
<%@ Page %>
<html><body>TEST
<p>.NET Version=<%= System.Environment.Version.ToString %>
<p>Now=<%= Now %>
<p>IP Remote User=<%= Request.ServerVariables("REMOTE_ADDR") %></body></html>


The same executed with C# works; here is the content:

debopweb02:/srv/_default/htdocs # cat index.cs.aspx
<%@ Page Language="C#" %>
<html><body>TEST
<p>.NET Version=<%= System.Environment.Version.ToString() %>
<p>Now=<%= System.DateTime.Now.ToString() %>
<p>IP Remote User=<%= Request.ServerVariables["REMOTE_ADDR"] %>
</body></html>


Both, C# and VB.NET fail if I use a control on my page provided by that cammWM.dll. Here the message from my hello_world_csharp.aspx:

Server Error in '/' Application

--------------------------------------------------------------------------------

The classes in the module cannot be loaded.
Description: HTTP 500. Error processing request.

Stack Trace:

System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000]
  at System.Web.UI.TemplateParser.FindNamespaceInAssembly (System.Reflection.Assembly asm, System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddAssemblyForNamespace (System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddImport (System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.RegisterNamespace (System.String tagPrefix, System.String ns, System.String assembly) [0x00000]
  at System.Web.UI.TemplateControlParser.AddDirective (System.String directive, System.Collections.Hashtable atts) [0x00000]
  at System.Web.Compilation.AspGenerator.TagParsed (ILocation location, TagType tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes) [0x00000]
  at System.Web.Compilation.AspParser.OnTagParsed (TagType tagtype, System.String id, System.Web.Compilation.TagAttributes attributes) [0x00000]
  at System.Web.Compilation.AspParser.Parse () [0x00000]
  at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader, System.String filename, Boolean doInitParser) [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].get_CodeCompilerType () [0x00000]
  at System.Web.Compilation.BuildManager.GetCodeDomProviderType (System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager+BuildItem..ctor (System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager.LoadBuildProviders (System.Web.VirtualPath virtualPath, System.String virtualDir, System.Collections.Generic.Dictionary`2 vpCache, System.Web.Compilation.BuildKind& kind, System.String& assemblyBaseName) [0x00000]

  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.LoadType () [0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.GetType (System.String componentName, System.String& source, System.String& ns) [0x00000]
  at System.Web.Compilation.AspComponentFoundry.CreateComponent (System.Web.Compilation.Foundry foundry, System.String tagName, System.String prefix, System.String tag) [0x00000]
  at System.Web.Compilation.AspComponentFoundry.GetComponent (System.String tagName) [0x00000]
  at System.Web.UI.RootBuilder.GetChildControlType (System.String tagName, IDictionary attribs) [0x00000]
  at System.Web.UI.ControlBuilder.CreateSubBuilder (System.String tagid, System.Collections.Hashtable atts, System.Type childType, System.Web.UI.TemplateParser parser, ILocation location) [0x00000]
  at System.Web.Compilation.AspGenerator.ProcessTag (ILocation location, System.String tagid, System.Web.Compilation.TagAttributes atts, TagType tagtype, System.Boolean& ignored) [0x00000]  

--------------------------------------------------------------------------------
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433


In case you need my cammWM.dll for testing purposes, please tell me your e-mail address so that I can send it directly to you (it shall be handled confidentially).

Environment configuration:
==========================
- OpenSUSE 11.1
- Mono 2.4.2 with installed mono-basic 2.4.2 (installed with zypper as advised by mono website)


Regards
Jochen

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

ASP.Net default language setting lost while update

by jwezel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

after I updated to Mono 2.4.2, I realized that the webserver doesn't work any more as expected.
This is because I configured the /etc/mono/2.0/web.config to use VB.NET as default language (before I installed the update).
After the update, this setting was overridden and pointed to C# again.

Since updates can be installed automatically by the Auto-Updater feature of OpenSUSE, it may fail again in future when next update is available.

Is there any plan to prevent overriding of my custom settings?
Or if no and it always overrides, can it override with the default M$ value (=VB) to keep compatible to M$ behaviour?

Regards
Jochen

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

ASP.Net compilation error with C# and Mono V2.4.2

by jwezel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I've got this error when trying to access my test website and if I've put a file "cammWM.dll" into my bin directory:

Given is the ASPX file with this content:

debopweb02:/srv/_default/htdocs # cat hello_world_csharp.aspx
<%@ Page Language="C#" %>
<%@ Register TagPrefix="camm" TagName="WebManager" Src="/system/cammWebManager.ascx" %>
<camm:WebManager id="cammWebManager" SecurityObject="@@Public" runat="server"></camm:WebManager>
<html>
<body>
<%
Response.Write ("<h1>This is a C# demo</h1>");
%>
<h3><asp:Label runat="server" id="UserWelcome" /></h3>
</body>
</html>
<script runat="server">
void Page_Load()
{
        UserWelcome.Text = "And you are " + cammWebManager.CurrentUserInfo().FullName() + "; a warm welcome to you!";
}
</script>


C# fails if I use a control on my page provided by that cammWM.dll. Here the message from my hello_world_csharp.aspx:

Server Error in '/' Application

--------------------------------------------------------------------------------

The classes in the module cannot be loaded.
Description: HTTP 500. Error processing request.

Stack Trace:

System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000]
  at System.Web.UI.TemplateParser.FindNamespaceInAssembly (System.Reflection.Assembly asm, System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddAssemblyForNamespace (System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddImport (System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.RegisterNamespace (System.String tagPrefix, System.String ns, System.String assembly) [0x00000]
  at System.Web.UI.TemplateControlParser.AddDirective (System.String directive, System.Collections.Hashtable atts) [0x00000]
  at System.Web.Compilation.AspGenerator.TagParsed (ILocation location, TagType tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes) [0x00000]
  at System.Web.Compilation.AspParser.OnTagParsed (TagType tagtype, System.String id, System.Web.Compilation.TagAttributes attributes) [0x00000]
  at System.Web.Compilation.AspParser.Parse () [0x00000]
  at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader, System.String filename, Boolean doInitParser) [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].get_CodeCompilerType () [0x00000]
  at System.Web.Compilation.BuildManager.GetCodeDomProviderType (System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager+BuildItem..ctor (System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager.LoadBuildProviders (System.Web.VirtualPath virtualPath, System.String virtualDir, System.Collections.Generic.Dictionary`2 vpCache, System.Web.Compilation.BuildKind& kind, System.String& assemblyBaseName) [0x00000]


  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.LoadType () [0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.GetType (System.String componentName, System.String& source, System.String& ns) [0x00000]
  at System.Web.Compilation.AspComponentFoundry.CreateComponent (System.Web.Compilation.Foundry foundry, System.String tagName, System.String prefix, System.String tag) [0x00000]
  at System.Web.Compilation.AspComponentFoundry.GetComponent (System.String tagName) [0x00000]
  at System.Web.UI.RootBuilder.GetChildControlType (System.String tagName, IDictionary attribs) [0x00000]
  at System.Web.UI.ControlBuilder.CreateSubBuilder (System.String tagid, System.Collections.Hashtable atts, System.Type childType, System.Web.UI.TemplateParser parser, ILocation location) [0x00000]
  at System.Web.Compilation.AspGenerator.ProcessTag (ILocation location, System.String tagid, System.Web.Compilation.TagAttributes atts, TagType tagtype, System.Boolean& ignored) [0x00000]  

--------------------------------------------------------------------------------
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433


In case you need my cammWM.dll for testing purposes, please tell me your e-mail address so that I can send it directly to you (it shall be handled confidentially).

Environment configuration:
==========================
- OpenSUSE 11.1
- Mono 2.4.2 with installed mono-basic 2.4.2 (installed with zypper as advised by mono website)


Regards
Jochen

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: ASP.Net default language setting lost while update

by Robert Jordan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jochen Wezel - CompuMaster GmbH wrote:
> Is there any plan to prevent overriding of my custom settings? Or if
> no and it always overrides, can it override with the default M$ value
> (=VB) to keep compatible to M$ behaviour?

Use your app's web.config for this kind of changes.

VB cannot be set as default, because its compiler and providers are
not as mature as gmcs'.

BTW, your 'S' key is damaged.

Robert

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: ASP.Net compilation error with C# and Mono V2.4.2

by Robert Jordan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jochen Wezel - CompuMaster GmbH wrote:
> Hello,
>
> I've got this error when trying to access my test website and if I've put a file "cammWM.dll" into my bin directory:
>
...

> Stack Trace:
>
> System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
>   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
>   at System.Reflection.Assembly.GetTypes () [0x00000]

Run this assembly through peverify under MS.NET to confirm
it's verifiable.

If yes, file a bug at http://mono-project.com/Bugs together with
a test case. IIRC, you can mark bugs as Novell-only, so you can
attach the assembly even if it's confidential.

Robert

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: ASP.Net compilation error with C# and Mono V2.4.2

by dr_d00m :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Same problem to me. I ran peverify on any assembly included in my
project, but all passed without any problems.
Did anyone already file a bug?

Ferdinand
Robert Jordan schrieb:

> Jochen Wezel - CompuMaster GmbH wrote:
>  
>> Hello,
>>
>> I've got this error when trying to access my test website and if I've
>> put a file "cammWM.dll" into my bin directory:
>>
>>    
> ...
>
>  
>> Stack Trace:
>> System.Reflection.ReflectionTypeLoadException: The classes in the
>> module cannot be loaded.
>>   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes
>> (bool)
>>   at System.Reflection.Assembly.GetTypes () [0x00000]    
>
> Run this assembly through peverify under MS.NET to confirm
> it's verifiable.
>
> If yes, file a bug at http://mono-project.com/Bugs together with
> a test case. IIRC, you can mark bugs as Novell-only, so you can
> attach the assembly even if it's confidential.
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@...
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>  


_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: ASP.Net default language setting lost while update

by jwezel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Robert,

> VB cannot be set as default, because its compiler and providers are
> not as mature as gmcs'.
Okay, hopefully the VB.Net compiler will get as mature as the gmcs in near future ;-)
I'm looking forward...

My idea is to better change it as soon as possible to reduce compatibility conflicts with existing Mono web applications (currently with a relatively small distribution grade in comparison to the distribution grade in approx. 2 years)

> BTW, your 'S' key is damaged.
Yeah, sorry - err - $orry ;-)

Regards
Jochen

-----Ursprüngliche Nachricht-----
Von: mono-list-bounces@... [mailto:mono-list-bounces@...] Im Auftrag von Robert Jordan
Gesendet: Donnerstag, 2. Juli 2009 12:50
An: Mono-list@...
Betreff: Re: [Mono-list] ASP.Net default language setting lost while update

Jochen Wezel - CompuMaster GmbH wrote:
> Is there any plan to prevent overriding of my custom settings? Or if
> no and it always overrides, can it override with the default M$ value
> (=VB) to keep compatible to M$ behaviour?

Use your app's web.config for this kind of changes.

VB cannot be set as default, because its compiler and providers are
not as mature as gmcs'.

BTW, your 'S' key is damaged.

Robert

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list