Why is my MVC web app throwing a CultureNotFoundException?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Why is my MVC web app throwing a CultureNotFoundException?

  1. #1
    Join Date
    Nov 2011
    Posts
    63

    Why is my MVC web app throwing a CultureNotFoundException?

    Hello,

    I'm running an MVC web application and I'm getting some weird errors upon starting the application. They aren't consistent--the errors seem different every time--but what is consistent is that my application just won't run properly.

    These errors started happening after rebooting my machine. No Windows updates were installed, although there are some updates that are ready to be downloaded and installed.

    I'm running Windows 7 and developing in VS 2015.

    Here are some examples of some of the more common errors I'm getting:

    1) This one happens upon trying to hit the website:

    System.Globalization.CultureNotFoundException occurred
    Message: Exception thrown: 'System.Globalization.CultureNotFoundException' in mscorlib.dll
    Additional information: Culture is not supported.

    2) This one happens after trying to click a few of the side menu items (which didn't respond):

    System.Web.HttpException occurred
    Message: Exception thrown: 'System.Web.HttpException' in System.Web.dll
    Additional information: Invalid file name for file monitoring: 'C:\Users\gshah\Source\Repos\RiskAlive\Web\features\Projects'. Common reasons for failure include:
    - The filename is not a valid Win32 file name.
    - The filename is not an absolute path.
    - The filename contains wildcard characters.
    - The file specified is a directory.
    - Access denied.

    3) Happened upon trying to hit the website:
    Happened at this line in DefaultRegistry.cs:

    public DefaultRegistry() {
    Scan(
    scan => {
    scan.AssembliesFromApplicationBaseDirectory(
    a => a.FullName.StartsWith("ACM"));
    scan.WithDefaultConventions();
    scan.With(new ControllerConvention());
    });
    }

    System.IO.FileNotFoundException occurred
    FileName=Microsoft.Build.Tasks.CodeAnalysis
    FusionLog==== Pre-bind state information ===
    LOG: DisplayName = Microsoft.Build.Tasks.CodeAnalysis
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: Microsoft.Build.Tasks.CodeAnalysis | Domain ID: 2
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Users/gshah/Source/Repos/RiskAlive/Web/
    LOG: Initial PrivatePath = C:\Users\gshah\Source\Repos\RiskAlive\Web\bin
    Calling assembly : StructureMap.Net4, Version=4.0.1.318, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\gshah\Source\Repos\RiskAlive\Web\web.config
    LOG: Using host configuration file: C:\Users\gshah\Documents\IISExpress\config\aspnet.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b1cac612/3c296358/Microsoft.Build.Tasks.CodeAnalysis.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b1cac612/3c296358/Microsoft.Build.Tasks.CodeAnalysis/Microsoft.Build.Tasks.CodeAnalysis.DLL.
    LOG: Attempting download of new URL file:///C:/Users/gshah/Source/Repos/RiskAlive/Web/bin/Microsoft.Build.Tasks.CodeAnalysis.DLL.
    LOG: Attempting download of new URL file:///C:/Users/gshah/Source/Repos/RiskAlive/Web/bin/Microsoft.Build.Tasks.CodeAnalysis/Microsoft.Build.Tasks.CodeAnalysis.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b1cac612/3c296358/Microsoft.Build.Tasks.CodeAnalysis.EXE.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b1cac612/3c296358/Microsoft.Build.Tasks.CodeAnalysis/Microsoft.Build.Tasks.CodeAnalysis.EXE.
    LOG: Attempting download of new URL file:///C:/Users/gshah/Source/Repos/RiskAlive/Web/bin/Microsoft.Build.Tasks.CodeAnalysis.EXE.
    LOG: Attempting download of new URL file:///C:/Users/gshah/Source/Repos/RiskAlive/Web/bin/Microsoft.Build.Tasks.CodeAnalysis/Microsoft.Build.Tasks.CodeAnalysis.EXE.

    HResult=-2147024894
    Message=Could not load file or assembly 'Microsoft.Build.Tasks.CodeAnalysis' or one of its dependencies. The system cannot find the file specified.
    Source=mscorlib
    StackTrace:
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    InnerException:

    On top of that, some of my CSS is not being loaded.

    I found this article online which explains exactly the problem I'm having with the CultureNotFoundException, but it doesn't offer a solution:

    https://edd.stefancamilleri.com/2013...oundexception/

    Any ideas as to what might be happening?

    Thanks.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,173

    Re: Why is my MVC web app throwing a CultureNotFoundException?

    What is the culture you are using?

    Are you using satellite assemblies?

    Are there additional folders in the same folders with any satellite assemblies?

    Have you reset IiS?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


HTML5 Development Center