Last post May 08, 2013 10:25 AM by Dunken
May 06, 2013 08:13 AM|Dunken|LINK
I have a application which is running fine. Now I want to deploy it within IIS. I load some assemblies by searching my own directory:
Unfortunately this doesn't work in IIS. IIS executes a search like:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\be54dee4\265f2001\assembly\dl3\167b1b9c\00efa401_ce49ce01\MyCompany.*.*Identifier*.dll
Of course this doesn't work as this folder contains only my own dll.
What would you suggest?
May 07, 2013 02:13 AM|ignatandrei|LINK
May 07, 2013 07:19 AM|Dunken|LINK
But I can't use Server.MapPath in a standalone application, can I?
May 08, 2013 03:40 AM|ignatandrei|LINK
I can't use Server.MapPath in a standalone application, can I?
What application are you talking about?! Is not a web application?
May 08, 2013 03:55 AM|Dunken|LINK
It's a component which is in this case is used in a web app. However, it's also used in a standalone app.
May 08, 2013 06:04 AM|ignatandrei|LINK
then pass to the component somehow the path where it should find the file.
May 08, 2013 10:25 AM|Dunken|LINK
Just found another solution which seems to work in both cases:
String^path = System::Uri(Path::GetDirectoryName(Assembly::GetExecutingAssembly()->CodeBase)).AbsolutePath;