JIT assemblies

B

Brian H

Hi everyone,

I'm trying to convert an ASP.NET app that is currently compiled into a JITed
application.

Here's the dilema. I can't figure out how to reference a class or control
(that is also JIT) from another JIT class or control. Let's say I've got a
simple class (testclass.cs) ... this is not compiled into a DLL:

namespace testnamespace
{
public class testclass
{
public static string teststring = "contents of teststring";
public testclass()
{
}
}
}

If I have a page w/o a code behind, I can access this class using:
<%@ Assembly Src="testclass.cs" %>
....
<%
Response.Write(testnamespace.testclass.teststring);
%>

All the pages are using code-behinds. Using "using testnamespace;" won't
work -- is there a way to reference and use this assembly from a
code-behind?

Thanks for your help!

Brian
 
G

Guest

This is EXACTLY the problem I'm having. It's been driving me CRAZY. They do all this nice AUTO-compilation stuff for us but then seem to provide no way to do JIT from a code file. ARRRGH. Hey, if you *do* learn the answer to this from anywhere else, could you email me? ([email protected]). Thanks!
 
G

Guest

Brian H

Hi. Well, though we haven't gotten a definite response from the MSFT folks yet, I gotta tell you that I've been banging my head against this for about 48 hours and I think that everything I've read and all the experimentation that I've done indicates the following annoying rule

IF YOU NEED TO ACCESSS THE CODE IN A .CS FILE IN ANY WAY DIRECTLY FROM ANOTHER .CS FILE, THE FIRST .CS FILE **MUST** BE PRE-COMPILED INTO AN ASSEMBLY WITH A NAMESPACE

It seems that ASP.NET itself does you a cool little "favor" when you're referencing code files (such as .CS files) as the code-behind files for .ASPXs or .ASCXs. The favor is that it will auto-compile what it needs to. Sadly, and, in my mind, rather stupidly, there doesn't seem to be any kind of directive to do this BETWEEN .CS code files

I'd *love* it if the folks from MSFT would write in and tell me that I'm an idiot and just don't understand how to do it. But at the moment, I think I may be right about this

Alex
 
B

Brian H

I've been banging my head on this one, too. I figured this would be a good
test case (the example I posted), but the real problem for us (and the
company I work for) is that we want to JIT compile our pages and user
controls. It won't be possible if what we are trying to do cannot be done.

I will post if I have a solution -- hopefully microsoft will figure this
out. Perhaps using reflection? Ug. This should be simple :)

-Brian


Alex Maghen said:
Brian H -

Hi. Well, though we haven't gotten a definite response from the MSFT folks
yet, I gotta tell you that I've been banging my head against this for about
48 hours and I think that everything I've read and all the experimentation
that I've done indicates the following annoying rule:
IF YOU NEED TO ACCESSS THE CODE IN A .CS FILE IN ANY WAY DIRECTLY FROM
ANOTHER .CS FILE, THE FIRST .CS FILE **MUST** BE PRE-COMPILED INTO AN
ASSEMBLY WITH A NAMESPACE.
It seems that ASP.NET itself does you a cool little "favor" when you're
referencing code files (such as .CS files) as the code-behind files for
..ASPXs or .ASCXs. The favor is that it will auto-compile what it needs to.
Sadly, and, in my mind, rather stupidly, there doesn't seem to be any kind
of directive to do this BETWEEN .CS code files.
I'd *love* it if the folks from MSFT would write in and tell me that I'm
an idiot and just don't understand how to do it. But at the moment, I think
I may be right about this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top