Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 共享主机-网站-如何让应用程序查找DLL_Asp.net_Dll - Fatal编程技术网

Asp.net 共享主机-网站-如何让应用程序查找DLL

Asp.net 共享主机-网站-如何让应用程序查找DLL,asp.net,dll,Asp.net,Dll,我有一个ASP.Net应用程序在共享托管网站上运行。该应用程序使用我创建的2个DLL。但是如果我把DLL放在网站根bin文件夹中,网站就不会加载。如果我把它们放在其他地方,应用程序就找不到DLL。该应用程序在我的pc上本地运行,并且DLL位于bin文件夹中。我将DLL的引用添加到我的项目中,并将“本地复制”选项设置为true。我联系了该网站的支持人员,他们说将DLL放在根目录wwwroot之外的一个新的bin文件夹中,我这样做了。说明中还说要编辑web.config文件并添加某些内容,我尝试了,

我有一个ASP.Net应用程序在共享托管网站上运行。该应用程序使用我创建的2个DLL。但是如果我把DLL放在网站根bin文件夹中,网站就不会加载。如果我把它们放在其他地方,应用程序就找不到DLL。该应用程序在我的pc上本地运行,并且DLL位于bin文件夹中。我将DLL的引用添加到我的项目中,并将“本地复制”选项设置为true。我联系了该网站的支持人员,他们说将DLL放在根目录wwwroot之外的一个新的bin文件夹中,我这样做了。说明中还说要编辑web.config文件并添加某些内容,我尝试了,但在新的web.config文件中发现了错误的模块类型

如果我从wwwroot/bin文件夹中重新移动DLL,则会出现以下错误:

Server Error in '/' Application.

Unable to load DLL 'trim_combos.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.DllNotFoundException: Unable to load DLL 'trim_combos.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[DllNotFoundException: Unable to load DLL 'trim_combos.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
   Powerball.trim(Int32[,] array, Int32 total, Int32 match) +0
   Powerball.combos_2() +26
   Lottery_C_Sharp_ASP._Default.Button15_Click(Object sender, EventArgs e) +86
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9628114
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
如果我将DLL放在wwwroot/bin文件夹中,则会出现以下错误:

Server Error in '/' Application.

Could not load file or assembly 'find_duplicates.DLL' or one of its dependencies. The specified module could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'find_duplicates.DLL' or one of its dependencies. The specified module could not be found.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'find_duplicates.DLL' or one of its dependencies. The specified module could not be found.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'find_duplicates.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): Could not load file or assembly 'find_duplicates.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
下面是他们为我提供的关于如何编辑web.config的示例。我想如果我能得到一些帮助,在没有错误的情况下,如何正确地完成这项工作,这将解决问题。即要使用的模块类型:

<configuration>

<configSections>
<section name=”MODULE”
type=”MODULE_TYPE, DLL_NAME” />
</configSections>

<system.web>
<httpModules>
<add name=”MODULE” type=”MODULE_TYPE, DLL_NAME” />
</httpModules>
</system.web>

<system.webServer>
<modules runAllManagedModulesForAllRequests=”true”>
<add name=”MODULE” type=”MODULE_TYPE” />
</modules>
<validation validateIntegratedModeConfiguration=”false” />
</system.webServer>

</configuration>

你的DLL应该在bin文件夹中。那是他们的归宿。如果你的网站无法加载,那么你就有另一个问题,如果你不发布具体的错误信息,我们不可能知道这是什么问题。我们不是魔法生物,不要期望我们在你不告诉我们的情况下知道你的错误。我已经编辑了你的标题。请看,如果一致意见是否定的,他们不应该这样做。如果没有任何细节,我觉得这像是一个IIS配置问题,你的Asp.net应用程序应该是wwwroot之外的自己的网站,还是在默认IIS网站下配置为IIS应用程序。详细的错误信息会让你得到更好的答案。我用错误信息编辑了原始帖子。有两个dll,find_duplicates.dll和trim_combos.dll。第一个错误发生在我单击主页上的按钮时,第二个错误只是加载页面。