Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
0 Points
7 Posts
library.dll.config is not found when execute (asp.net throw iofile.notfound exception)
05-15-2016 10:08 AM|LINK

I'm developing asp.net application that uses a 3rd party API, and one of the API use a config file (dll.config).

I access the function in the API using class (.cs) file. When I try to run it, it throws a file not exception and the API won't start.

I tried to run exact same code in the WPF approach, the code works fine.

After review and searching, I tried to use configuration manager yet it does not solve my problem.

Here I attach what I've tried.


C#
thrown error from this project 

DebugCategory Information: 3 : An error occurred in DCN-SW API initializing the server link: .Config file 'Bosch.Dcn.Ecpc.Client.Logic.dll.config' cannot be read successfully due to exception 'System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002) at System.BaseConfigHandler.RunParser(String fileName) at System.ConfigTreeParser.Parse(String fileName, String configPath, Boolean skipSecurityStuff) at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ParseConfigFile(String filename) at System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(String filename)'. DebugCategory Information: 4 : Availability state of the DCN-SW API changed from b to a.


What I have tried:

public void config3()
{
string path = "E:\\LiveStreaming\\testLiveStreaming\\testLiveStreaming\\bin\\Bosch.Dcn.Ecpc.Client.Logic.dll.config";
System.Diagnostics.Debug.WriteLine("path " + path);

try
{
RemotingConfiguration.Configure(path, false);
}
catch (Exception et)
{
System.Diagnostics.Debug.WriteLine("error conf " + et.Message);
}
}
Posted
Comments
Sergey Alexandrovich Kryukov 1-Jun-16 22:54pm    
There are no cases when hard-coded path name could be useful. (Even with WPF :-)
In ASP.NET, or with any other kind of Web application. even the existing file could be inaccessible, because Web application is not allowed to access any file system objects beyond the root directory set up for the site.
—SA
azwa_amrie 2-Jun-16 21:39pm    
that code is what i tried after googling around.. for the wpf, i simply add reference to the library and include the dll.config in the project and run it. but for the asp.net, i try the same thing, it does not work .. after that only, i've tried this. thanks. @SAKryukov

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900