Author |
|
Beachcomber Newbie
Joined: 20 August 2008 Location: United Kingdom
Online Status: Offline Posts: 7
|
Posted: 20 August 2008 at 6:00am | IP Logged
|
|
|
Having got the web app (with MailBee imap component working pretty nicely) I tried compiling it for use on our server.
I use aspnet_compiler for this. First attempt seemed to compile OK, but when I tried using the app and came to the web page that has the imap control on it, I got an error saying that the file had not been pre-compiled. I thought that this might be because the MailBee is not installed on the server itself, only on my development machine. So I thought that I would put a copy of the dll into the BIN folder of the source code. Now I get:
C:\WINDOWS>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ aspnet_compiler.exe -p
c:\code\source -v / c:\firedefencecompiled
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.
c:\Code\Source\pop.aspx.cs(32): error CS0433: The type 'MailBee.ImapMail.Imap' e
xists in both 'c:\WINDOWS\assembly\GAC\MailBee.NET\4.0.1.105__cd85b70fb26f 9fc1\M
ailBee.NET.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\MailBee.NET\4.0.2.105__cd85b70
fb26f9fc1\MailBee.NET.dll'
error ASPPARSE: c:\Code\Source\pop.aspx.cs(32): error CS0433: The type 'MailBee.
ImapMail.Imap' exists in both 'c:\WINDOWS\assembly\GAC\MailBee.NET\4.0.1.105__cd
85b70fb26f9fc1\MailBee.NET.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\MailBee.NET\4.
0.2.105__cd85b70fb26f9fc1\MailBee.NET.dll'
(this is the trial version, by the way).
Without the .dll in the BIN folder, it appears to compile OK, but apparently is not pre-compiled.
What should I do, please, to put this as a compiled web app on the server?
Thanks
Steve
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 20 August 2008 at 6:55am | IP Logged
|
|
|
The issue seems to be caused by a lack of explicit reference to MailBee.NET.dll in your project. There are 2 versions of MailBee.NET.dll with the same API, and the compiler cannot choose one of them.
Add parts missing in your web.config from the following web.config sample:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MailBee.NET"
publicKeyToken="cd85b70fb26f9fc1"
culture="neutral" />
<bindingRedirect oldVersion="4.0.2.105"
newVersion="4.0.2.105"/>
<codeBase version="4.0.2.105"
href="bin\MailBee.NET.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> |
|
|
The directives above should explicitly direct the compiler to proper MailBee.NET.dll version.
Regards,
Igor
|
Back to Top |
|
|
Beachcomber Newbie
Joined: 20 August 2008 Location: United Kingdom
Online Status: Offline Posts: 7
|
Posted: 20 August 2008 at 7:54am | IP Logged
|
|
|
Hi Igor,
Thanks for that. I tried putting that in to my web.config file, but got the error:
Error 34   ; C:\net\pop.aspx: ASP.NET runtime error: Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element. (C:\net\web.config line 24) C:\net\pop.aspx 1 1 &nbs p; C:\net\
What I did have in the web.config file was:
<configuration>
<!-- Added for AJAX extensions -->
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGro up, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandle rSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGr oup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSec tion, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSectio n, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServic eSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ScriptServices.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<connectionStrings>
<add name="in161_FD" connectionString="server=SQLSRV;database=in161_FD_Steve;Inte grated Security=SSPI" providerName="System.Data.SqlClient"/>
<add name="MailServer" connectionString="192.168.0.5"/>
<add name="MailBeeLicence" connectionString="MN200-2DE5E589E57CE51EE569B486E9C8-2F7C"/& gt;
</connectionStrings>
etc. - there is quite a lot more in there.
So I added your code:
configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> ;
<assemblyIdentity name="MailBee.NET"
publicKeyTok en="cd85b70fb26f9fc1"
culture="neu tral" />
<bindingRedirect oldVersion="4.0.2.105"
newVersion="4.0.2. 105"/>
<codeBase version="4.0.2.105"
href=" bin\MailBee.NET.dll"/>
</dependentAssembly&g t;
</assemblyBinding>
</runtime>
<!-- Added for AJAX extensions -->
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGro up, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandle rSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGr oup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSec tion, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSectio n, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServic eSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ScriptServices.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
which raised the error above. I then moved your bit so that it was inside the <configurations> section.
That came up with a different error, unrecognized element (<runtime>).
Not knowing much about this area, I tried changing the <compilation> part, where there are several <add assembly entries, including one for MailBee. I changed that to:
<add assembly="MailBee.NET, Version=4.0.1.105, Culture=neutral, PublicKeyToken=CD85B70FB26F9FC1 href=bin\MailBee.NET.dll"/>
but that was no good, not surprisingly I suppose.
While reporting these areas, it also objected to the first line in the .aspx file:
<%@ Page EnableViewState="true" MaintainScrollPositi onOnPostback="true" ValidateRequest="false" Language="C#" MasterPageFile="~/FDnet.master" AutoEventWireup="true" CodeFile="pop.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
Thanks
Steve
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 21 August 2008 at 1:11am | IP Logged
|
|
|
We've replied you via e-mail.
Regards,
Igor
|
Back to Top |
|
|
|
|