0

I am trying to use aspnet_compiler.exe to compile a webapp project. While doing that I am getting error in windows 2019 server (has .net framework 4.8.03761) but it compiles fine on windows 10 pro ( .net framework 4.8.04084).

In aspx file I have:

<asp:HtmlIframe name="docViewFrame" id="docViewFrame" runat="server"
        sandbox="allow-forms allow-popups allow-pointer-lock allow-scripts allow-same-origin allow-top-navigation">
    </asp:HtmlIframe>

In .cs file it is defined as:

protected global::System.Web.UI.HtmlControls.HtmlIframe docViewFrame;

I am getting this error when I run it in windows 2019 server:

The type or namespace name 'HtmlIframe' does not exist in the namespace 'System.Web.UI.HtmlControls' (are you missing an assembly reference?)

It looks like this is happening because of the version different of .net 4.8 framework in both the machines (so the version of aspnet_compiler.exe is also slightly different). The same code works on windows 10 pro, with the same .net framework 4.8. I cannot upgrade the .net framework version in windows 2019 server.

Samuel
  • 1,949
  • 4
  • 18
  • 30
  • Did you run windows update to get latest version? Also in VS Solution Explorer compare references. You may need to add a missing reference using the menu project : Add References. You can open the csproj files with notepad and compare the reference versions of the HtmlControls. The HtmlFrame reference may be missing. – jdweng Nov 03 '20 at 17:37
  • Yes windows update ran on the target machine and also both the .csproj files are identical. – Samuel Nov 03 '20 at 18:09
  • Did you do a clean build? The dependencies of the compile do not recognize Net updates so the intermediate obj files probably didn't get recompiled. – jdweng Nov 03 '20 at 18:26
  • Did a clean build and the problem persist. The only way I found to avoid the issue is to copy the compiler from the windows 10 machine and run it on windows 2019 server. – Samuel Nov 08 '20 at 13:17
  • Why can't you update the Net Version in Widows 2019 server? Looks like something was fixed. Hopefully a Monthly push will fix issue when Updates are installed. – jdweng Nov 08 '20 at 14:31
  • I last updated a couple of weeks ago. If it was fixed after that then it may have been fixed. Although I doubt it. I will take a look – Samuel Nov 10 '20 at 21:47
  • Did you update the drivers/dlls on the motherboard at the vendors website? The motherboard drivers/dlls do not get updated by the Windows Updates and there are dlls that still get called by the Net Library. – jdweng Nov 11 '20 at 09:21
  • I did not update the motherboard drivers as copying the aspnet_compiler.exe from another machine (that had the more recent version of the .net ) fixed the issue. I think that it is the version of asp.net compiler in server 2019 is creating the issue. I will watch out for updates from microsoft. – Samuel Nov 27 '20 at 23:11

0 Answers0