English 中文(简体)
为什么这一类图书馆无法从阅览中获得信息。
原标题:Why is this class library dll not getting information from app.config

我正在开发一个HttpHandler习俗,以便我写出一个C#级图书馆,并汇编到DL。

作为这项工作的一部分,我有一些目录点,我想不要在座标上硬化,这样一米试图把它放在我以前使用的座标上。

在此之前,刚刚开始建造app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="Share" value="C:..."/>
  </appSettings>
</configuration>

之后,在法典中取得了这样的成绩:

var shareDirectory = ConfigurationManager.AppSettings["Share"];

但是,当我汇编并把它放在网络服务的双倍夹中时,它就会使<条码>共享目录/代码>失效,这很可能是因为它可能找不到。 因此,我如何确保列入这段内容,因此我无需硬性地把我可怕的地理地点规范下来? 我注意到,这基本上是在汇编我们之后。 dll and the Assembly. dll.config, 它是 app子,因此,在双倍的夹中就这样界定了。

最佳回答

你可能混淆了贵班图书馆的范围。

你们的敬业者,无论是网络的,还是组合的,都是千篇一律的。 在这种情况下,您的主机是网络服务,当然由国际空间法研究所主办,因此,你的汇辑是网上的。

如果你有某种how使用该类图书馆的灯光镜(虽然可能不是在手里),那么该信会就是圣像中的 app,而不是贵级图书馆的 app。

问题回答

这是因为您的web服务使用web.config

你们需要把该组合放在你们的网站上。 组合文件,而不是组装。 dll.config文档。





相关问题
What form is DLL & what makes it processor dependent

I know DLL contains one or more exported functions that are compiled, linked, and stored separately.. My question is about not about how to create it.. but it is all about in what form it is stored.. ...

Create Visual Fox Pro DBF with activex

any one knows if there is a activex dll that can create VFP DBF files? I mean im writing app with 1C:Enterprise 8.2 language, and i need to export some datas into VFP DBF. And i can only use activex ...

Dynamically loading a dll in C#

I have a window to use for editing. The editor should load a dll (which I have full control of) in response to the user s selection to know how to display the information visually. (They re dll s, as ...

How do I link to a DLL from javascript in XULRunner?

I have a dll (that I didn t write) and I would like to use it in an XULRunner application. I know nearly nothing about this, so bear with me. Apparently I can use XPCOM to load the dll and then call ...

Is there a minimal php5ts.dll?

I ve completed my web app and am using mongoose to serve the php pages. The whole app & mongoose is less then 2MB. The php5ts.dll is almost 5MB so that really adds bloat. Also, my app is very ...

DllGetVersion not giving expected results under Windows 7

I have some code that attempts to test whether my application is running with the themes set. Here s the C# code: internal class NativeMethods { [DllImport("comctl32", CharSet = CharSet.Auto, ...

How to restrict access to my DLL

Is possible to restrict access to my .NET DLL library? My application has more EXE assemblies and I need share some code, but I don t want someone else could use that.

Creating a thread in DllMain?

It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it won t begin until all dll s have been loaded. Since I need to make sure the thread runs before I continue, I get a ...

热门标签