473,378 Members | 1,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

ASP.Net Runtime Hosting and finding Assemblies

Hi all,

I'm building an app that uses the ASP.Net runtime...

One problem I've run into is that pages running inside of the runtime are
not finding DLLs in the GAC. In fact, if I look at the debug trace of the
search path it searches the bin directory and Temporary ASP files but not
the GAC.

A simple example I used was trying to load System.Windows.Forms. If I add a
reference to my project and make it copy local it works. If I don't do this
however and the DLL lives only in the GAC it does not.

For example, if I do:

<%@page language="C#" trace="true"%>
<%@assembly name="System.Windows.Forms"%>
When this page loads it gets:

=== Pre-bind state information ===
LOG: DisplayName = System.Windows.Forms
(Partial)
LOG: Appbase = D:\projects\AspNetHosting\bin\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : System.Web, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: System.Windows.Forms
LOG: Attempting download of new URL
file:///D:/projects/AspNetHosting/bin/Debug/System.Windows.Forms.DLL.
LOG: Attempting download of new URL
file:///D:/projects/AspNetHosting/bin/Debug/System.Windows.Forms/System.Windows.Forms.DLL.
LOG: Attempting download of new URL
file:///D:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/localscript/853d03f1/399ca7d6/System.Windows.Forms.DLL.
LOG: Attempting download of new URL
file:///D:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/localscript/853d03f1/399ca7d6/System.Windows.Forms/System.Windows.Form
s.DLL.
LOG: Attempting download of new URL
file:///D:/projects/AspNetHosting/bin/Debug/System.Windows.Forms.EXE.
LOG: Attempting download of new URL
file:///D:/projects/AspNetHosting/bin/Debug/System.Windows.Forms/System.Windows.Forms.EXE.
LOG: Attempting download of new URL
file:///D:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/localscript/853d03f1/399ca7d6/System.Windows.Forms.EXE.
LOG: Attempting download of new URL
file:///D:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/localscript

I've tried both custom loading (custom CreateApplicationHost()) and the
default HttpRuntime.CreateApplicationHost(). Both exhibit this same
behavior.

Anybody have any ideas how I can change it so the GAC is probed? Or maybe on
more broad terms - if I build my domain manually how does it see the GAC...

I was under the impression that no matter what the GAC would be accessed. In
this context however it appears that htis is not the case..

TIA,
+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web

Nov 17 '05 #1
8 2004
Hi rick,

if you make reference to your own signed assembly do you still get that
error ?
I try it (System.Windows.Forms from web app) on my machine and it works.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
Hi rick,

if you make reference to your own signed assembly do you still get that
error ?
I try it (System.Windows.Forms from web app) on my machine and it works.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Hi Natty,

Well, from a Web app it works. It's from within the ASP.Net Runtime host
that it doesn't appear to work.

I have a page that does:

<%@page language="C#%>
<%@import assembly="system.windows.form" %>

<%
System.Windows.Form.MessageBox.Show(...);
%>

This doesn't work (can't find Windows.Forms). If I copy local then it does.
If I use my own private signed assembly and stick it in the GAC it's also
not found.
What's weird is if I use a precompiled page (with codebehind) it DOES work
(presumably because it's hard bound at compile time as opposed to the JIT
compilation at runtime).
This means that the AppDomain can get to the GAC, but it's not searching
there automaitcally if trying to dynamically locate an assembly.

Unfortunately in this case this won't work because I'm using the ASP.Net
runtime as a scripting plug in for my app.

The issue here is that the domain apparently isn't configured right so that
it finds things in the GAC...

Any ideas?

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web
"Natty Gur" <na***@dao2com.com> wrote in message
news:u#**************@TK2MSFTNGP11.phx.gbl...
Hi rick,

if you make reference to your own signed assembly do you still get that
error ?
I try it (System.Windows.Forms from web app) on my machine and it works.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4
Hi Natty,

Well, from a Web app it works. It's from within the ASP.Net Runtime host
that it doesn't appear to work.

I have a page that does:

<%@page language="C#%>
<%@import assembly="system.windows.form" %>

<%
System.Windows.Form.MessageBox.Show(...);
%>

This doesn't work (can't find Windows.Forms). If I copy local then it does.
If I use my own private signed assembly and stick it in the GAC it's also
not found.
What's weird is if I use a precompiled page (with codebehind) it DOES work
(presumably because it's hard bound at compile time as opposed to the JIT
compilation at runtime).
This means that the AppDomain can get to the GAC, but it's not searching
there automaitcally if trying to dynamically locate an assembly.

Unfortunately in this case this won't work because I'm using the ASP.Net
runtime as a scripting plug in for my app.

The issue here is that the domain apparently isn't configured right so that
it finds things in the GAC...

Any ideas?

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web
"Natty Gur" <na***@dao2com.com> wrote in message
news:u#**************@TK2MSFTNGP11.phx.gbl...
Hi rick,

if you make reference to your own signed assembly do you still get that
error ?
I try it (System.Windows.Forms from web app) on my machine and it works.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5
Hi,

Are you familiar with this article?

http://www.microsoft.com/belux/nl/ms...esmet/hostaspn
et1.mspx

It mentions there that you need to register the assembly of your
self-written ASP.NET runtime host in the GAC.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6
Hi,

Are you familiar with this article?

http://www.microsoft.com/belux/nl/ms...esmet/hostaspn
et1.mspx

It mentions there that you need to register the assembly of your
self-written ASP.NET runtime host in the GAC.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #7
Hi Natty,

Thanks for the link to the article - hadn't seen this before, but I've been
through all that long ago <g>...

The issue I have now is that the ASP.Net pages that are running are not
finding anything in the GAC. IOW, the @Import statement is finding things
fine from the bin directory but not from the GAC.

I'm not sure why this would be - I was under the impression that no matter
what the Runtime will always look in the GAC first for anything in the first
place...
+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web
"Natty Gur" <na***@dao2com.com> wrote in message
news:eF**************@tk2msftngp13.phx.gbl...
Hi,

Are you familiar with this article?

http://www.microsoft.com/belux/nl/ms...esmet/hostaspn
et1.mspx

It mentions there that you need to register the assembly of your
self-written ASP.NET runtime host in the GAC.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #8
Rick Hi,

It's interesting... can you send me sample project so I can struggle
with you...

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alan Roberts | last post by:
Is it possible to have conditional references and code execution in csharp? I have an app that plays Windows Media asx streams. It requires WMP 9+ to be installed for this to work and so this is a...
8
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
5
by: Charles Law | last post by:
I want to display the name and version of all assemblies (dlls?) used/required by my application in a Help | About box. Is there a way to do this? One of the problems I anticipate is that...
2
by: Peter Zolja | last post by:
I use a third party for hosting; and the only way I can update my site is with FTP. To make the site faster I was wondering if I could somehow NGEN the generated assemblies (2.0 BTW) and use those...
10
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am wondering whether Microsoft Excel 2003 is a native application or dependent on any .Net Framework Runtime, like 1.1, 2.0 or 3.0? How about Microsoft Excel 2007? ...
3
by: Kulgan | last post by:
Hi We have a serious problem here with a 1.1 web app that has been upgraded to 2.0! Our web app can optionally use Crystal Reports. This means that it must be compiled on a machine with the...
6
by: Scott M. | last post by:
When attempting to target a specific version of the .NET Framework in my application configuration file, I get an error saying that: "To run this application, you must first install one of the...
0
by: creo | last post by:
OS: Windows XP (32 bit) NET: .Net 2.0 runtime DevEnv: VS 2008 C++ and C# I am attempting to use an unmanaged C++ library to load a managed C# assembly and hand off control. I have the following...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.