Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How do i get the path of my project directory at designtime

I am making a custom control designer inside of VS, and i need to find a way to add a designer file for the custom controls that are made in my designer.
My problem is that i can't find a way to get the path of the project directory at design time, all the usually methods returns the path of the Vs folder :/

Any ideas? :)
Can you please elaborate? What file do you want to open?
(Oct 14, 2011 01:33 PM)Sapientia Wrote:  Can you please elaborate? What file do you want to open?

The project folder, where all the code files are stored.
(Oct 14, 2011 01:36 PM)BlackCap Wrote:  The project folder, where all the code files are stored.

Code
"System.Reflection.Assembly.GetAssembly().Location" ???
[Image: logo.gif]
(Oct 14, 2011 01:41 PM)n0$f3ratu$ Wrote:  
Code
"System.Reflection.Assembly.GetAssembly().Location" ???

Nope, at design time it returns a location in the appdata even througth my project is both builded and saved..
Dim AppPath As String = My.Application.Info.DirectoryPath
Thread: Backend Web-Dev. - by SomeWhiteGuy

WATCH OUT 'LIL HOE,
MY PARTNA STILL SMOKE ON PAROLE
selling -
megabits.org + freakin.pro
(Oct 14, 2011 02:37 PM)SomeWhiteGuy Wrote:  Dim AppPath As String = My.Application.Info.DirectoryPath

I have allready tryed it and it does not work at design time
(Oct 14, 2011 02:40 PM)BlackCap Wrote:  I have allready tryed it and it does not work at design time

I don't understand what you're trying to do.

/Elaborate
Thread: Backend Web-Dev. - by SomeWhiteGuy

WATCH OUT 'LIL HOE,
MY PARTNA STILL SMOKE ON PAROLE
selling -
megabits.org + freakin.pro
What do you mean at "Design Time"? Are you talking about when you debug it ?
Like when you are debugging it? I believe that's because you're either using a temporary project, or that's just how Visual Studio works with debugging.
Are you think about Application.StartPath? Im confused.
(Oct 14, 2011 04:47 PM)Banksу Wrote:  Like when you are debugging it? I believe that's because you're either using a temporary project, or that's just how Visual Studio works with debugging.

This is design time:
Spoiler (Click to View)

Like a sayed, it's a custom designer to create custom controls (like the form designer), and i neded the path of the project so that i could generate designer files for the custom controls made with it.
Just in case someone else need it, i managed to get the path from the EnvDTE.DTE class found in the EnvDTE dll.
Look at my above post, use Application.Startpath
(Oct 15, 2011 02:14 AM)Coleak Wrote:  Look at my above post, use Application.Startpath

You should test it before you post. It where the first method i tested, and i't returns a location in the appdata.
(Oct 15, 2011 02:36 AM)BlackCap Wrote:  You should test it before you post. It where the first method i tested, and i't returns a location in the appdata.

Alright, then what is the problem?
Take the path from appdata, because is obvious you put the "working" folder there.
[Image: logo.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by nicodemoNov 3, 2019 08:25 AM 5 158 Nov 3, 2019 08:25 AM
Last Post: Anzee
[Python] by george12324Aug 14, 2019 10:23 AM 1 165 Aug 14, 2019 10:23 AM
Last Post: Wiked™
[Shell] by BattalaxicJan 4, 2019 04:23 AM 2 125 Jan 4, 2019 04:23 AM
Last Post: Money-