DLL change path
Moderators: DllAdmin, DLLADMIN ONLY
DLL change path
Hello,
Nice forum! Hope you can answer my question.
I have a DLL file that points to C:\map and I can changed that directory (with Reflexil, plug-in for Reflector) and that works fine. But what I actually want is that it points to its current directory without defining C:\ etc.
Is that possible?
I really hope so!
Thanks!
Nice forum! Hope you can answer my question.
I have a DLL file that points to C:\map and I can changed that directory (with Reflexil, plug-in for Reflector) and that works fine. But what I actually want is that it points to its current directory without defining C:\ etc.
Is that possible?
I really hope so!
Thanks!
Re: DLL change path
Try to change the C:\map to . (dot only, nothing else) usually . (dot) means the current directory.
Try that and let us know if that worked.
C:\map => .
Try that and let us know if that worked.
C:\map => .
Re: DLL change path
Thanks for your reply!
I changed it but it doesn't point to the current directory.
It points to:
C:\Windows\SysWOW64\inetsrv\
Do you know how to solve this?
Thanks again!
I changed it but it doesn't point to the current directory.
It points to:
C:\Windows\SysWOW64\inetsrv\
Do you know how to solve this?
Thanks again!
Re: DLL change path
And maybe this helps you a little:
private void InitialiseCatalogName()
{
string filename = Path.Combine(".", "settings.xml");
XmlDocument document = new XmlDocument();
document = this.Load(filename);
XmlNode node = document.SelectSingleNode(this.GetXmlLocationCatalogName());
if (node == null)
Thats the piece of code and as you can see I replaced C:\map with the dot.
private void InitialiseCatalogName()
{
string filename = Path.Combine(".", "settings.xml");
XmlDocument document = new XmlDocument();
document = this.Load(filename);
XmlNode node = document.SelectSingleNode(this.GetXmlLocationCatalogName());
if (node == null)
Thats the piece of code and as you can see I replaced C:\map with the dot.
Re: DLL change path
Try this in
string filename = Path.Combine(Environment.CurrentDirectory, "settings.xml");
string filename = Path.Combine(Environment.CurrentDirectory, "settings.xml");
Re: DLL change path
Pfft now it proudly points to
'C:\Windows\SysWOW64\inetsrv\Environment.CurrentDirectory\settings.xml'
Unbelievable right.
I did exactly what you said:
string filename = Path.Combine("Environment.CurrentDirectory", "settings.xml");
Are there any other options or am I still doing something wrong?
Thank you very much again for your reply!
'C:\Windows\SysWOW64\inetsrv\Environment.CurrentDirectory\settings.xml'
Unbelievable right.
I did exactly what you said:
string filename = Path.Combine("Environment.CurrentDirectory", "settings.xml");
Are there any other options or am I still doing something wrong?
Thank you very much again for your reply!
Re: DLL change path
Hi again,
Do not put quotes in Environment.CurrentDirectory , this is the Environment variable, there is no need for " " (quotes) around that!
Just copy and paste it like this:
Path.Combine(Environment.CurrentDirectory, "settings.xml");
Do not put quotes in Environment.CurrentDirectory , this is the Environment variable, there is no need for " " (quotes) around that!
Just copy and paste it like this:
Path.Combine(Environment.CurrentDirectory, "settings.xml");
Re: DLL change path
I am trying to remove them but with Reflexil it’s impossible. And the dll file is compiled so when I decompile it with Visual Studio and the Reflector plug-in, I can change it like you said but impossible to compile again I think.
Are you sure that the problem is the quotes? Because if that’s what you think it is I will do everything to remove them.
Thank you very much again! I appreciate your replies
Are you sure that the problem is the quotes? Because if that’s what you think it is I will do everything to remove them.
Thank you very much again! I appreciate your replies
Re: DLL change path
I think the problem is in the quotes because if you put a string in quotes that means that the path is that one in between quotes.
But what you need to do is add a variable instead of string. The variable Environment.CurrentDirectory is the dynamic variable for the current directory (obviously). If you can make it work without the quotes that I think would be a solution.
You can also try to leave the path empty like this "" but I doubt this will work.
But what you need to do is add a variable instead of string. The variable Environment.CurrentDirectory is the dynamic variable for the current directory (obviously). If you can make it work without the quotes that I think would be a solution.
You can also try to leave the path empty like this "" but I doubt this will work.
Re: DLL change path
I changed it but didn't work either
I solved it now but used a workaround.
Thanks for all your replies and your help!!
I solved it now but used a workaround.
Thanks for all your replies and your help!!
Re: DLL change path
Hi Erjen,
It would be the best if you could tell what was the workaround! Other people might find it useful.
Thanks.
It would be the best if you could tell what was the workaround! Other people might find it useful.
Thanks.
-
- Posts: 1
- Joined: 13 Nov 2020, 16:54
Re: DLL change path
Erjen wrote:
> I am trying to remove them but with Reflexil it’s impossible. And the dll
> file is compiled so when I decompile it with Visual Studio and the
> Reflector plug-in, I can change it like you said but impossible to compile
> again I think.
Usually DLLs that I decompile with http://Decompiler.com/ are compilable back. This decompiler produces a project structure that can be then imported into any IDE.
> I am trying to remove them but with Reflexil it’s impossible. And the dll
> file is compiled so when I decompile it with Visual Studio and the
> Reflector plug-in, I can change it like you said but impossible to compile
> again I think.
Usually DLLs that I decompile with http://Decompiler.com/ are compilable back. This decompiler produces a project structure that can be then imported into any IDE.
-
- Posts: 1
- Joined: 03 Dec 2020, 10:59
Re: DLL change path
Go to project properties (Alt+F7)
Under Debugging, look to the right
There's an Environment field.
Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending PATH=%PATH%;$(ProjectDir)\some-framework\lib or prepending to the path PATH=C:\some-framework\lib;%PATH%
Hit F5 (debug) again and it should work.
Under Debugging, look to the right
There's an Environment field.
Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending PATH=%PATH%;$(ProjectDir)\some-framework\lib or prepending to the path PATH=C:\some-framework\lib;%PATH%
Hit F5 (debug) again and it should work.
-
- Posts: 1
- Joined: 14 Jun 2021, 11:07
Re: DLL change path
Once it's in a path directory, use the where command to verify windows can find the right one.But downloading random dll files and letting your programs load them is usually a bad idea.
In your Project properties(Right click on project, click on property button) ▶ Configuration Properties ▶ Build Events ▶ Post Build Events ▶ Command Line. Edit and add one instruction to command line. for example copy botan. dll from source path to location where is being executed the program.
In your Project properties(Right click on project, click on property button) ▶ Configuration Properties ▶ Build Events ▶ Post Build Events ▶ Command Line. Edit and add one instruction to command line. for example copy botan. dll from source path to location where is being executed the program.
Last edited by paulritik_09 on 14 Jun 2021, 11:11, edited 1 time in total.
Re: DLL change path
your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending PATH=%PATH%;$(ProjectDir)\some-framework\lib or prepending to the path PATH=C:\some-framework\lib;%PATH%