Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / February 2005

Tip: Looking for answers? Try searching our database.

Determining Path to Project File at Design Time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mark@arcabama.com - 17 Feb 2005 03:48 GMT
I am running into several situations where I need to determine the full
path to the "current" project file at design-time within VS.NET. For
example, I've written a custom component that, based on user input,
creates and adds a dataset definition file to it's project.

I've come up with a way of doing this, but I don't like it; it feels
very kludgy.

Is there some design-time service that I can access to get the project
file path? Or, if that's not available, how about a service that can
give me a reference to the project's assembly?

Thanx in advance for any help/advice.

- Mark
"Jeffrey Tan[MSFT]" - 17 Feb 2005 08:34 GMT
Hi Mark,

Thanks for your posting!!

I think VS.net design-time classes did not expose this function. We should
use VS.net IDE automation to query this information through Design-time
code. We may loop through the current project and get the current project's
ProjectItem object, then use ProjectItem.FullPath property to get the
directory path information.

To get more information about how to automate VS.net IDE in design-time
code, please refer to the article below:
"Reading the ASP.NET Web.config file Design Time"
http://blogs.madtechnology.net/chris/archive/2004/07/20/432.aspx

Hope this helps
==================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

mark@arcabama.com - 17 Feb 2005 18:07 GMT
Jeffrey,

Thanx for the quick reply. The reference you cite is very similar to
what I do already (which I still feel is kludgy/ugly). But if it's the
best technique available, well, c'est la vie!

Does anyone else have any other suggestions?

I've toyed with adding a custom service to my designers, which would
probably work, but it sure seems like this is a very common need
whenever you need to interact with the designtime environment.

I realize that there isn't a single type of designtime environment, but
still, maybe this could be added as a feature.

- Mark
joeycalisay - 18 Feb 2005 01:37 GMT
IMO, the only possible way to do this is what you've been using, interacting
with the EnvDTE class.

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Jeffrey,
>
[quoted text clipped - 12 lines]
>
> - Mark
"Jeffrey Tan[MSFT]" - 18 Feb 2005 02:15 GMT
Hi Mark,

Thanks for your feedback!!

Yes, I agree with Joey that VS.net IDE automation should be the only
available way of retrieving this information. Anyway, let's wait to see if
other community members have any good suggestion.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.