过去一周,这个问题一直让我发疯。
我们将3.5解决方案迁移到4.0(使用EF4开始),这里没有大问题。我已经使用Visual Studio 2010 Final一段时间没有任何问题。
将解决方案和关联的第三方程序集迁移到.net 4.0,虽然运行时性能与3.5级相同,但启动调试程序现在大约需要2:30到3:00 ,在几台好机器上(Core i7,Core i5笔记本电脑和带有大量内存的Phenom 4x台式机)。
在3.5解决方案中,所有过程大约需要20-30秒 !!,幸运的是,如果我们在没有调试的情况下启动站点并且仅在没有问题的情况下附加调试器,并且一切似乎都没问题。< / p>
输出窗口我得到的是 4000首次异常,这似乎会减慢过程:
mscorlib.dll中出现'System.Globalization.CultureNotFoundException'类型的第一次机会异常
我已经调试了这个异常但没有结论,似乎在CultureInfo方法名称= Resx上,显然这不是一个正确的文化:
public CultureInfo(String name, bool useUserOverride) {
if (name==null) {
throw new ArgumentNullException("name",
Environment.GetResourceString("ArgumentNull_String"));
}
Contract.EndContractBlock();
// Get our data providing record
this.m_cultureData = CultureData.GetCultureData(name, useUserOverride);
if (this.m_cultureData == null)
throw new CultureNotFoundException(
"name", name, Environment.GetResourceString("Argument_CultureNotSupported"));
this.m_name = this.m_cultureData.CultureName;
this.m_isInherited = (this.GetType() != typeof(System.Globalization.CultureInfo));
}
这是堆栈跟踪:
> mscorlib.dll!System.Globalization.CultureInfo.CultureInfo(string name, bool useUserOverride) Line 264 + 0xef bytes C#
System.Web.dll!System.Web.HttpServerUtility.CreateReadOnlyCultureInfo(string name) + 0xb8 bytes
System.Web.dll!System.Web.UI.Util.IsCultureName(string s) + 0x84 bytes
System.Web.dll!System.Web.UI.Util.GetCultureName(string virtualPath) + 0x4a bytes
System.Web.dll!System.Web.Util.HashCodeCombiner.AddResourcesDirectory(string directoryName) + 0x18c bytes
System.Web.dll!System.Web.Util.HashCodeCombiner.AddResourcesDirectory(string directoryName) + 0x16c bytes
System.Web.dll!System.Web.Util.HashCodeCombiner.AddResourcesDirectory(string directoryName) + 0x16c bytes
System.Web.dll!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(System.Web.Compilation.StandardDiskBuildResultCache diskCache) + 0x13a bytes
System.Web.dll!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(System.Web.Compilation.StandardDiskBuildResultCache diskCache) + 0x38 bytes
System.Web.dll!System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize() + 0xaf bytes
System.Web.dll!System.Web.Compilation.BuildManager.Initialize() + 0x106 bytes
System.Web.dll!System.Web.Compilation.BuildManager.InitializeBuildManager() + 0xb8 bytes
System.Web.dll!System.Web.HttpRuntime.HostingInit(System.Web.Hosting.HostingEnvironmentFlags hostingFlags, System.Security.Policy.PolicyLevel policyLevel, System.Exception appDomainCreationException) + 0x15f bytes
System.Web.dll!System.Web.HttpRuntime.InitializeHostingFeatures(System.Web.Hosting.HostingEnvironmentFlags hostingFlags, System.Security.Policy.PolicyLevel policyLevel, System.Exception appDomainCreationException) + 0x3c bytes
System.Web.dll!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager appManager, System.Web.Hosting.IApplicationHost appHost, System.Web.Configuration.IConfigMapPathFactory configMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters hostingParameters, System.Security.Policy.PolicyLevel policyLevel, System.Exception appDomainCreationException) + 0x224 bytes
System.Web.dll!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager appManager, System.Web.Hosting.IApplicationHost appHost, System.Web.Configuration.IConfigMapPathFactory configMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters hostingParameters, System.Security.Policy.PolicyLevel policyLevel) + 0x1d bytes
[Appdomain Transition]
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0xfd1 bytes
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x2f bytes
System.Web.dll!System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x67 bytes
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateObjectInternal(string appId, System.Type type, System.Web.Hosting.IApplicationHost appHost, bool failIfExists, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x4d bytes
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateObject(string appId, System.Type type, string virtualPath, string physicalPath, bool failIfExists, bool throwOnError) + 0x8d bytes
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateObject(string appId, System.Type type, string virtualPath, string physicalPath, bool failIfExists) + 0x35 bytes
WebDev.WebHost40.dll!Microsoft.VisualStudio.WebHost.Server.GetHost() + 0x14b bytes
WebDev.WebHost40.dll!Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(object acceptedSocket) + 0xa7 bytes
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state) Line 1507 + 0xb bytes C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) Line 441 + 0xe bytes C#
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Line 1486 + 0x22 bytes C#
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 974 C#
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Line 1341 + 0x5 bytes C#