Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Terry Clancy 204 posts 944 karma points
    Jul 23, 2020 @ 07:10
    Terry Clancy
    0

    Using aspnet_compiler.exe: The type or namespace name 'UmbracoViewPage' could not be found

    Hi All,

    I am running Umbraco 7.5.10 (with uCommerce) and my project works well on my Dev / VS machine.

    I have now also been able to deploy to a (Go Daddy) hosted web server and have managed to do that successfully using Visual Studio Web Deploy (Publish).

    Now I am trying to deploy in the much the same manner (using Visual Studio Web Deploy / Publish) but this time with the following options: • Precompile during publishing • DO NOT allow precompiled site to be updatable

    This results in the build process calling aspnet_compiler.exe as follows:

    C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\TempBuildDir
    

    This results in a large number of warnings I do not yet understand, and am not worrying about these right now such as the following:

    2>ASPNETCOMPILER(0,0): Warning CS1685: The predefined type 'System.Collections.Generic.IReadOnlyList' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll'
    
    2>ASPNETCOMPILER(0,0): Warning CS1685: The predefined type 'System.Collections.Generic.IReadOnlyCollection' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll'
    

    But the Error I AM worried about and need assistance with please is the following:

    2>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b29e350b\ca96019b\App_Web_vivjsxxz.1.cs(25,0): Error CS0246: The type or namespace name 'UmbracoViewPage' could not be found (are you missing a using directive or an assembly reference?)
    

    From what I can tell UmbracoViewPage == Umbraco.Web.Mvc.UmbracoViewPage and that exists in the assembly “umbraco.dll” which exists in my bin folder as well as in the obj location used by aspnetcompiler.exe at C:\Clancy\ATeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source\bin . So I do not understand the reason why “ 'UmbracoViewPage' could not be found ” ???

    Also, how can I debug this !!!! It says the error exists in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b29e350b\ca96019b\AppWebvivjsxxz.1.cs(25,0) which means nothing to me, and does not exist, after the build fails and I go to look at it. How can I tell what line, in what file, in my source code is causing this error ??

    Any help would be appreciated.

    Thanks

    Terry Clancy

    ClanceZ

  • Terry Clancy 204 posts 944 karma points
    Jul 24, 2020 @ 22:46
    Terry Clancy
    0

    Also for reference, if I call the aspnet_compiler.exe from the command line with the debug options "-d" and "-errorstack" as follows:

    aspnetcompiler.exe -f -d -errorstack -v / -p C:\Clancy\ATeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\TempBuildDir

    Then I get the following more detailed error message. However I still do not understand the reason why “ 'UmbracoViewPage' could not be found ” ???

    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b29e350b\ca96019b\AppWebnm3iq5p3.1.cs(26): error CS0246: The type or namespace name 'UmbracoViewPage' could not be found (are you missing a using directive or an assembly reference?)

    [HttpCompileException]: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b29e350b\ca96019b\AppWebnm3iq5p3.1.cs(26): error CS0246: The type or namespace name 'UmbracoViewPage' could not be found (are you missing a using directive or an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(AssemblyBuilder builder) at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilderParallel(ICollection assemblyBuilders) at System.Web.Compilation.WebDirectoryBatchCompiler.CompileNonDependentBuildProviders(ICollection buildProviders) at System.Web.Compilation.WebDirectoryBatchCompiler.Process() at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List1 excludedVirtualPaths) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback) at System.Web.Compilation.Precompiler.Main(String[] args)

    Thanks

    Terry Clancy

    ClanceZ

  • Terry Clancy 204 posts 944 karma points
    Jul 29, 2020 @ 16:42
    Terry Clancy
    101

    OK I have resolved this issue and I am embarrassed to say that the solution was fairly straight forward. (1) Rather than try to navigate to the file in the location listed in ……….\Temporary ASP.NET Files....... I double clicked on the error in the Error List pane in VS to see the offending file. (2) That file was not an exact copy of my source, but did have a line added near the top with the complete path to the original source file. (3) In the original source file I then had to resolve the errors (remove the red squiggly lines) which in my case meant adding a “Using” statement (4) One thing to note is that many pages that which worked OK before I tried to “PreCompile” the site, cause errors when being compiled by aspnet_compiler.exe. It seems a lot stricter than the JIT approach ? Thanks again for your assistance.

    Terry Clancy ClanceZ

Please Sign in or register to post replies

Write your reply to:

Draft