GdalRasterLayer in a web application

Topics: SharpMap Project, SharpMap v0.9 / v1.x, Web Controls
Mar 28, 2008 at 9:28 AM
Edited Mar 28, 2008 at 9:32 AM
Hello,

I tried to use a GdalRasterLayer in a web application and it failed.
I have downloaded the patch here : http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SharpMap&DownloadId=24213
I have launched the DemoWinform, and it works fine.
But if I try to do a web project i have this error (sorry it's in french) :

Impossible de charger le fichier ou l'assembly 'gdalconst_csharp' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)

FileLoadException: Impossible de charger le fichier ou l'assembly 'gdalconst_csharp' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

ConfigurationErrorsException: Impossible de charger le fichier ou l'assembly 'gdalconst_csharp' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3479033
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +525
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +448

HttpException (0x80004005): Impossible de charger le fichier ou l'assembly 'gdalconst_csharp' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

HttpException (0x80004005): Impossible de charger le fichier ou l'assembly 'gdalconst_csharp' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3426839
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +149


I have put all the dll dependencies in the bin directory of my web site. I don't know what is the problem with gdalconst_csharp.

Thanks for your help.
Mar 28, 2008 at 9:51 AM
I have doubs using gdalconst_wrap.dll in a web project.

I mean the example is a winforms project do the dll work in a webform project ?
Developer
Mar 28, 2008 at 12:09 PM
just a guess: maybe something to do with access rights.
Developer
Apr 8, 2008 at 9:01 AM
Edited Apr 8, 2008 at 9:02 AM
I just did a test with the trunk:
http://www.codeplex.com/SharpMap/SourceControl/DownloadSourceCode.aspx?changeSetId=32732

Added a Gdal test to DemoWebSite based on:
http://www.codeplex.com/SharpMap/SourceControl/FileView.aspx?itemId=430866&changeSetId=32732

copied all the dll's of the bin dir of fwtools 2.2.0 to DemoWebSite/Bin
and it worked okay.
Apr 18, 2008 at 9:21 AM
i can't download fwtools 2.2.0 http://home.gdal.org/fwtools/FWTools220.exe

pauldendulk, can you send this file to me, thanks :-) cdqrain@gmail.com