PDA

View Full Version : سوال: دلیل بروز خطای Server Error in '/' Application



vahid4251
شنبه 18 تیر 1390, 15:54 عصر
سلام بچه ها من يك برنامه هست ميخوام نصبش كنم كه هي اين ارورو رو ميده پدرمو در اورده همه كارش كردم


Server Error in '/' Application.

Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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.BadImageFormatException: Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'UserLocation' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[BadImageFormatException: Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAs semblyHelper(String assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException: Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAs semblyHelper(String assemblyName, Boolean starDirective) +11224200
System.Web.Configuration.CompilationSection.LoadAl lAssembliesFromAppDomainBinDirectory() +388
System.Web.Configuration.CompilationSection.LoadAs sembly(AssemblyInfo ai) +232
System.Web.Configuration.AssemblyInfo.get_Assembly Internal() +48
System.Web.Compilation.BuildManager.GetReferencedA ssemblies(CompilationSection compConfig) +210
System.Web.Compilation.BuildProvidersCompiler..cto r(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76
System.Web.Compilation.CodeDirectoryCompiler.GetCo deDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11213378
System.Web.Compilation.BuildManager.CompileCodeDir ectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
System.Web.Compilation.BuildManager.CompileCodeDir ectories() +654
System.Web.Compilation.BuildManager.EnsureTopLevel FilesCompiled() +658

[HttpException (0x80004005): Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Compilation.BuildManager.ReportTopLevel CompilationException() +76
System.Web.Compilation.BuildManager.EnsureTopLevel FilesCompiled() +1012
System.Web.Hosting.HostingEnvironment.Initialize(A pplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025

[HttpException (0x80004005): Could not load file or assembly 'UserLocation' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +11318198
System.Web.HttpRuntime.EnsureFirstRequestInit(Http Context context) +88
System.Web.HttpRuntime.ProcessRequestNotificationP rivate(IIS7WorkerRequest wr, HttpContext context) +4348404

Version Information: Microsoft .NET Framework Version:2.0.50727.5416; ASP.NET Version:2.0.50727.5419

ممنون ميشم سريع جواب بدين پروژه دانشگاهيمه بايد بدم

TeacherMath
شنبه 18 تیر 1390, 18:13 عصر
توی پروژه از یک کنترل استفاده کردین که اسمبلی آن از برنامه حذف شده یا به درستی رجیستر نشده است.
UserLocation

vahid4251
یک شنبه 19 تیر 1390, 00:53 صبح
توی پروژه از یک کنترل استفاده کردین که اسمبلی آن از برنامه حذف شده یا به درستی رجیستر نشده است.
UserLocation
ميشه يكم جامع تر بگين ببخشين

ParsaNM
یک شنبه 20 شهریور 1390, 17:17 عصر
براي رفع مشکلت بايد بري روي refrenceهاي داخل برنامه و properties رو انتخاب کن و گزينه copy local رو true کن اينطوري هنگام publish يه نسخه از dll مربوطه همراه با برنامه ات فرستاده مي شه...

http://barnamenevis.org/attachment.php?attachmentid=75185&d=1315743115 (http://barnamenevis.org/attachment.php?attachmentid=75185&d=1315743115)

در اينصورت مشکل زير حل ميشه ...!

http://barnamenevis.org/attachment.php?attachmentid=75186&d=1315743173 (http://barnamenevis.org/attachment.php?attachmentid=75186&d=1315743173)