473,779 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

design-time-only references


I am implementing a component that helps a developer with som
localization tasks at design-time, and provides some related feature
at run-time.

My problem is that in order to do the design-time stuff, I need
reference to EnvDTE or EnvDTE80 (I'm using Whidbey beta 2). However,
can't ship these .dlls and I don't need them at run-time anyway. If
simply add a reference to envdte.dll in my project, then th
design-time stuff works, but I also have to ship envdte.dll a
run-time; otherwise my component will fail to load.

I tried using late binding. I broke the stuff that used envdte.dll int
its own .dll, had my component load it using Assembly.Load() inside
test to see whether it was design-time or not. Then I used reflectio
to invoke methods out of the .dll. This breaks the dependency, but i
has a problem: any objects returned by methods that I'm calling throug
reflection are actually __COMObject stubs represented wit
MarshalByRefObj ect, and I can't use reflection on them successfully
For example, one of my methods in the design-time support .dll return
an EnvDTE.Project. From within my component code I see this as a
object (since my component no longer has a reference to EnvDTE and thu
is late-bound). I know that the object type should have a propert
called "UniqueName ":

object proj = /*call design-time support dll and return a Project */;
//proj is *not* null here
PropertyInfo pi = proj.GetPropert y("UniqueName") ;
//pi *is* null here, but if I put the same calls in the design-tim
support dll instead of the component dll, it's not.

I assume that what's happening is that there's an AppDomain boundar
between my component and the EnvDTE stuff, and because the actual pro
variable is a proxy to the real object in the other AppDomain, I'm no
able to use reflection on it?

I wondered if I could just use /delayload on my component dll (that wa
at run-time the design-time support .dll would never be loaded), bu
that appears to only apply to C++ projects.

I'm stumped at this point. Any brilliant ideas would be appreciated
:-)

--Danie

--
danielhardmanPo sted from http://www.pcreview.co.uk/ newsgroup acces

Nov 17 '05 #1
1 2612
danielhardman wrote:
I am implementing a component that helps a developer with some
localization tasks at design-time, and provides some related features
at run-time.
It sounds like you need to split your design-time helpers into an addin,
and package your run-time methods into a separate distributable assembly.

JB
My problem is that in order to do the design-time stuff, I need a
reference to EnvDTE or EnvDTE80 (I'm using Whidbey beta 2). However, I
can't ship these .dlls and I don't need them at run-time anyway. If I
simply add a reference to envdte.dll in my project, then the
design-time stuff works, but I also have to ship envdte.dll at
run-time; otherwise my component will fail to load.

I tried using late binding. I broke the stuff that used envdte.dll into
its own .dll, had my component load it using Assembly.Load() inside a
test to see whether it was design-time or not. Then I used reflection
to invoke methods out of the .dll. This breaks the dependency, but it
has a problem: any objects returned by methods that I'm calling through
reflection are actually __COMObject stubs represented with
MarshalByRefObj ect, and I can't use reflection on them successfully.
For example, one of my methods in the design-time support .dll returns
an EnvDTE.Project. From within my component code I see this as an
object (since my component no longer has a reference to EnvDTE and thus
is late-bound). I know that the object type should have a property
called "UniqueName ":

object proj = /*call design-time support dll and return a Project */;
//proj is *not* null here
PropertyInfo pi = proj.GetPropert y("UniqueName") ;
//pi *is* null here, but if I put the same calls in the design-time
support dll instead of the component dll, it's not.

I assume that what's happening is that there's an AppDomain boundary
between my component and the EnvDTE stuff, and because the actual proj
variable is a proxy to the real object in the other AppDomain, I'm not
able to use reflection on it?

I wondered if I could just use /delayload on my component dll (that way
at run-time the design-time support .dll would never be loaded), but
that appears to only apply to C++ projects.

I'm stumped at this point. Any brilliant ideas would be appreciated.
:-)

--Daniel

Nov 17 '05 #2

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

Similar topics

3
1820
by: jenniferyiu | last post by:
IMHO, simply NO. False actually, practically.
2
19143
by: Ray | last post by:
Stop me if you've heard this, but I am running Access 2002 and all of a sudden, if I design a particular form (it's been working fine for ages), Access crashes rather than open it in design view. Interestingly, it doesn't crash if I run the app and open it in form view! Just if I attempt to design it. If I compact/repair, it allows me to design the form once. On any subsequent attempts to view in design mode, though, it crashes before...
13
6562
by: John Salerno | last post by:
Here are a few I'm considering: Design Patterns Explained : A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway Design Patterns C# by Steven John Metsker Design Patterns by Erich Gamma Head First Design Patterns by Elisabeth Freeman
16
2332
by: sailor.gu | last post by:
Hi all guys, As an embeded programmer with five year C experience, I did read many great books related with design, coding, test,debug,algorithms, compiler, design, os, pm and others. I always dream to achieve a refined and reusable design and implementation. I am very interested with code reuse.
2
2377
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm, (which itself derives from System.Windows.Forms.Form) Whenever I try to open on of these forms in the designer, I get an error, stating it is unable to load one or more of the requested types. (Full text at the bottom of this message)
5
2375
by: Ludwig Wittgenstein | last post by:
Other than the Design Patterns book, which book(s) is/are the best to learn object-oriented software design/architecture from ?
34
2194
by: Nate | last post by:
Scenario: In a commerce application, there is a Product class. Along with the Product class there is a form (the text that goes in the labels of the input controls) for inputting and updating existing instances of existing Product objects. We'll call the second a ProductForm. Both would be data-driven. I view these as 2 distinct classes. Product and ProductForm. Where Product contains the business end and ProductForm contains the...
1
1532
by: mae2x | last post by:
Web design High-quality web & graphics Designs. That eye catching multimedia and web design developments highly skilled web programmers and designers that have extensive experience in website design and development services. Wicked Innovations
6
2141
by: JoeC | last post by:
I have a question about designing objects and programming. What is the best way to design objects? Create objects debug them and later if you need some new features just use inhereitance. Often times when I program, I will create objects for a specific purpose for a program and if I need to add to it I just add the code.
8
2237
by: indrawati.yahya | last post by:
In a recent job interview, the interviewer asked me how I'd design classes for the following problem: let's consider a hypothetical firewall, which filters network packets by either IP address, port number, or both. How should we design the classes to represent these filters? My answer was: class FilterRule {
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.