0 Replies - 2074 Views - Last Post: 06 May 2016 - 10:13 AM

#1 gib65  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 02-February 16

Why is my MVC web app throwing a CultureNotFoundException?

Posted 06 May 2016 - 10:13 AM

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());
                });
        }
:code:

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..../?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.stefanca...foundexception/

Any ideas as to what might be happening?

Thanks.

This post has been edited by modi123_1: 06 May 2016 - 11:14 AM
Reason for edit:: use the '[ code ]' button in the editor.


Is This A Good Question/Topic? 0
  • +

Page 1 of 1