none
asp.net不支持区域性名称“444”。 参数名: name RRS feed

  • 问题

  • [ArgumentException: 不支持区域性名称“444”。
    参数名: name]
      System.Globalization.CultureTableRecord..ctor(String cultureName, Boolean useUserOverride) +7485129
      System.Globalization.CultureTableRecord.GetCultureTableRecord(String name, Boolean useUserOverride) +213
      System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) +45
      System.Reflection.Assembly.GetLocale() +66
      System.Reflection.Assembly.GetName(Boolean copiedName) +124
      System.Reflection.Assembly.GetName() +9
      System.Web.Compilation.BuildResultCompiledAssemblyBase.SetPreservedAttributes(PreservationFileWriter pfw) +75
      System.Web.Compilation.BuildResultCompiledType.SetPreservedAttributes(PreservationFileWriter pfw) +17
      System.Web.Compilation.PreservationFileWriter.SaveBuildResultToFile(String preservationFile, BuildResult result, Int64 hashCode) +500
      System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) +95
      System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) +76
      System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +524
      System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
      System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
      System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
      System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +19
      System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
      System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    

    3.5版本asp.netwebform正常,一般处理程序报这个错误,而自定义httphandler也没有问题,就只有ashx文件有这个错误,求指点。
    2011年6月15日 6:48

答案

全部回复

  • 你是不是要做类似于“本地化”或者根据CultureInfo指定的某个语言?请列出你的关键代码。

    注意:CultureInfo只能用于指定某个国家的名称——CultureInfo.C

    具体支持的国家和区域,请查http://msdn.microsoft.com/zh-cn/library/system.globalization.cultureinfo(v=vs.80).aspx表。

    同时建议查看这个例子——如何创建有针对性的Culture?


    http://msdn.microsoft.com/zh-cn/library/system.globalization.cultureinfo.createspecificculture(v=VS.80).aspx#Y1380

    如果你有其它意见或私下交流,请发送邮件到:maledong@qq.com;或者请讨论
    下载MSDN桌面工具(Vista,Win7)
    下载Technet桌面小工具(Vista,Win7)
    慈善点击,点击此处

    2011年6月15日 9:07
  • 你好,我这里并没有做本地化的设置,asp.net默认生成的ashx文件就有这个问题,怀疑是web.config文件配置的问题,下面就是web.config的配置信息了

    <?xml version="1.0"?>
    <!-- 
      注意: 除了手动编辑此文件以外,您还可以使用 
      Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
       “网站”->“Asp.Net 配置”选项。
      设置和注释的完整列表在 
      machine.config.comments 中,该文件通常位于 
      \Windows\Microsoft.Net\Framework\v2.x\Config 中
    -->
    <configuration>
     <configSections>
      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
       <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
         <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
         <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
         <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
         <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
       </sectionGroup>
      </sectionGroup>
     </configSections>
     <appSettings />
     <connectionStrings />
     <system.web>
      <sessionState mode="StateServer"  stateConnectionString="tcpip=127.0.0.1:42424"  cookieless="false" timeout="20" />
      <!-- 
          设置 compilation debug="true" 可将调试符号插入
          已编译的页面中。但由于这会 
          影响性能,因此只在开发过程中将此值 
          设置为 true。
        -->
      <compilation debug="true">
       <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
       </assemblies>
      </compilation>
      <!--
          通过 <authentication> 节可以配置 ASP.NET 用来 
          识别进入用户的
          安全身份验证模式。 
        -->
      <authentication mode="Windows"/>
      <!--
          如果在执行请求的过程中出现未处理的错误,
          则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
          开发人员通过该节可以配置
          要显示的 html 错误页
          以代替错误堆栈跟踪。
    
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
          <error statusCode="403" redirect="NoAccess.htm" />
          <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
      <pages>
       <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       </controls>
      </pages> 
      <httpHandlers>
       <remove verb="*" path="*.asmx"/>
       <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      </httpHandlers>
      <httpModules>
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </httpModules>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN"/>
     </system.web>
     <system.codedom>
      <compilers>
       <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="WarnAsError" value="false"/>
       </compiler>
      </compilers>
     </system.codedom>
     <!-- 
        在 Internet 信息服务 7.0 下运行 ASP.NET AJAX 需要 system.webServer
        节。对早期版本的 IIS 来说则不需要此节。
      -->
     <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
       <remove name="ScriptModule"/>
       <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </modules>
    
      <handlers>
       <remove name="WebServiceHandlerFactory-Integrated"/>
       <remove name="ScriptHandlerFactory"/>
       <remove name="ScriptHandlerFactoryAppServices"/>
       <remove name="ScriptResource"/>
       <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </handlers>
     </system.webServer>
     <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
       </dependentAssembly>
      </assemblyBinding>
     </runtime>
    </configuration>
    


    2011年6月15日 9:32
  • 你好:)

    请重新创建一个空的项目,然后创建ashx看看是否也是这样?


    如果你有其它意见或私下交流,请发送邮件到:maledong@qq.com;或者请讨论
    下载MSDN桌面工具(Vista,Win7)
    下载Technet桌面小工具(Vista,Win7)
    慈善点击,点击此处
    2011年6月16日 8:13
  • 新的方案是没有问题的,这个问题之前也遇到过,总之有些莫名其妙。
    2011年6月16日 9:38