Dear Forum Readers,
I translated a custom VB module to C# by an online service. There where still minor syntax errors that I got rid off. Event handling in C# web controls goes differently than in VB and I fixed that. C# pages and DNN website are building with no errors and warnings just like the VB version.
web.config:
<codeSubDirectories>
<add directoryName="SATOCONOR_Portfolio_Display_CS"/>
</codeSubDirectories>
But the SATO_Portfolio_Display VB-version loads and functions normally and the C#-version SATOCONOR_Portfolio_Display_CS gives a ModuleLoadException!
Error: Display in C# is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: External component has thrown an exception. ---> System.Web.HttpCompileException: External component has thrown an exception. at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---
There is no extra information in event log viewer.
DNNDebug.aspx is not useful for code behind user controls only for scripts.
From experience I know that ModuleLoadExceptions usually come from errors in the *.dnn. But I cannot find an error anyway I give the text here:
<dotnetnuke version="3.0" type="Module">
<folders>
<folder>
<name>DNN_SATOCONOR</name>
<friendlyname>Display/CS</friendlyname>
<foldername>SATOCONOR_Portfolio_Display_CS</foldername>
<modulename>SATOCONOR_Portfolio_Display_CS</modulename>
<description>Displays and monitors the interest rate (%) of 20 selected stocks in time against the market index. In CSharp (C#.NET).</description>
<version>01.00.00</version>
<businesscontrollerclass>DotNetNuke.Modules.SATOCONOR</businesscontrollerclass>
Or (does not matter):
<businesscontrollerclass>DotNetNuke.Modules.SATOCONOR.Display</businesscontrollerclass>
DotNetNuke.Modules.SATOCONOR.Display = namespace + view control class. In the VB there is only the namespace!
<modules>
<module>
<friendlyname>Display/CS</friendlyname>
<cachetime>0</cachetime>
<controls>
<control>
<src>DesktopModules/SATOCONOR_Portfolio_Display_CS/DisplayCS.ascx</src>
<type>View</type>
<helpurl></helpurl>
</control>
</controls>
</module>
</modules>
<files>
<file>
<path>App_LocalResources</path>
<name>DisplayCS.ascx.resx</name>
</file>
<file>
<path>App_LocalResources</path>
<name>EditDisplayCS.ascx.resx</name>
</file>
<file>
<name>DisplayCS.ascx</name>
</file>
<file>
<name>DisplayCS.ascx.cs</name>
</file>
<file>
<name>EditDisplayCS.ascx</name>
</file>
<file>
<name>EditDisplayCS.ascx.cs</name>
</file>
<file>
<name>SPD_CSVFILES.TXT</name>
</file>
<file>
<path>[App_Code]</path>
<name>DOWN5CPDOWN5CPV.cs</name>
</file>
<file>
<path>[App_Code]</path>
<name>QuotesClass.cs</name>
</file>
<file>
<path>[App_Code]</path>
<name>TOP5CPTOP5CPV.cs</name>
</file>
<file>
<path>[App_Code]</path>
<name>WebServiceXCS.cs</name>
</file>
<file>
<path>[App_Code]Providers\DataProviders\SqlDataProviders</path>
<name>SqlDataProvider.cs</name>
</file>
</files>
</folder>
</folders>
</dotnetnuke>
What am I doing wrong or can the DNN core not yet handle every form and kind of C# modules?
Many thanks in advance.
PLEASE HELP!
Kind regards,
Johan van der Galiën.