维生素C.net

We cannot solve our problems with the same thinking we used when we created them

统计

常用链接

留言簿

Comm Use

阅读排行榜

评论排行榜

2010年2月8日 #

查看Sql Server的log文件大小

SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) = 'AdventureWorks'
GO

posted @ 2010-02-08 11:14 new 维生素C.net() 阅读(23) | 评论 (0)编辑

2010年1月5日 #

打开无线后无法自动发现连接点的问题

装完Server 2008 R2随手将WinHTTP Web Proxy Auto-Discovery Service服务stop然后设置成Manual方式启动了。看描述是:WinHTTP implements the client HTTP stack and provides developers with a Win32 API and COM Automation component for sending HTTP requests and receiving responses. In addition, WinHTTP provides support for auto-discovering a proxy configuration via its implementation of the Web Proxy Auto-Discovery (WPAD) protocol.

第一眼看的时候就没完全明白其意图,所以导致我无线总是无法找到连接点。今天早上重装了一遍驱动后竟然可以了,再重启,还是不行,再重装,又可以了。

刚才终于忙完了所有的工作,用net start > c:\1.txt将所有的started的windows service定向到文本里,再装驱动,再保存一份到另一个文件,一对比,除了windows installer就是WinHttpAutoProxySvc这个服务了,设置成自动启动,再start,重启系统就不影响了。

wow yeah!

update:经再次验证,这个结论是错误的。

posted @ 2010-01-05 23:40 new 维生素C.net() 阅读(35) | 评论 (0)编辑

Microsoft.TeamFoundation.VersionControl.Client.dll的位置

在:C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies

这个只有32位的。

posted @ 2010-01-05 00:19 new 维生素C.net() 阅读(33) | 评论 (0)编辑

2009年12月24日 #

两台机器.net版本一样,但是抓的包里mscordacwks.dll却不一样?

0:000> !clrstack
CLRDLL: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\mscordacwks.dll:2.0.50727.3082 f:0
doesn't match desired version 2.0.50727.3053 f:0
DBGHELP: D:\symbols\mscordacwks_AMD64_AMD64_2.0.50727.3053.dll\4889E8709b1000\mscordacwks_AMD64_AMD64_2.0.50727.3053.dll - OK
CLRDLL: Loaded DLL D:\symbols\mscordacwks_AMD64_AMD64_2.0.50727.3053.dll\4889E8709b1000\mscordacwks_AMD64_AMD64_2.0.50727.3053.dll
OS Thread Id: 0x39c (0)
Unable to walk the managed stack. The current thread is likely not a
managed thread. You can run !threads to get a list of managed threads in
the process

奇怪。。。

posted @ 2009-12-24 11:07 new 维生素C.net() 阅读(36) | 评论 (0)编辑

2009年12月22日 #

Unknown exception 0xe0434f4e

If you attach windows debugger to a .Net framework application, occasionally you may see debug spew of unknown exception 0xe0434f4e.

(cfc.1244): Unknown exception - code e0434f4e (first chance)

0xe0434f4e is defined as EXCEPTION_HIJACK.

(Copied from Rotor 2.0 sources corexcep.h)

#define EXCEPTION_HIJACK  0xe0434f4e    // 0xe0000000 | 'COM'+1

EXCEPTION_HIJACK is thrown by CLR as part of the process of suspending threads for garbage collection. It's raised to help resume execution after a suspension.

来自:http://blogs.msdn.com/junfeng/archive/2007/07/16/unknown-exception-0xe0434f4e.aspx

posted @ 2009-12-22 14:53 new 维生素C.net() 阅读(71) | 评论 (0)编辑

2009年12月20日 #

在x64平台上用x86模式run托管程序debug的方法

被一件事儿困惑了许久:

我们使用的TFS 2008做源代码,使用CruiseControl.net做持续集成,由于ccnet1.5还不是release的,所以需要使用vsts.cruisecontrol.net这个插件,而这个插件只能以32bit方式运行,所以ccnet在x64上启动后默认就是以64bit方式运行,是无法加载32bit only的assembly的,因为处理的方式使用corflags,使ccnet按照32bit的方式运行。

问题是ccnet不断的报告中断。查看log等也没找到问题所在,无奈,抓包。头疼开始了:

0:025> .loadby sos mscorwks
0:025> .reload
..........................WARNING: mscorjit overlaps mscoree
..............................WARNING: wldap32 overlaps dnsapi
........
..WARNING: rasapi32 overlaps dnsapi
...WARNING: tapi32 overlaps rasapi32
.WARNING: rtutils overlaps rasman
..............WARNING: setupapi overlaps winsta
....
0:025> !clrstack
Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
            2) the file mscordacwks.dll that matches your version of mscorwks.dll is
                in the version directory
            3) or, if you are debugging a dump file, verify that the file
                mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
            4) you are debugging on the same architecture as the dump file.
                For example, an IA64 dump file must be debugged on an IA64
                machine.

You can also run the debugger command .cordll to control the debugger's
load of mscordacwks.dll.  .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your executable
path is pointing to mscorwks.dll as well.

又是Failed to load data access DLL,0x80004005。这个问题到是常见,可是我是在同一台机器上做debug,提示里说的4个问题我应该不存在才对。

有点无奈了,不过,这是一个-crash模式的dump,一打开的时候应该会有些提示内容的,让我们回过头去看看:

Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.

Loading Dump File [D:\Crash_Mode__Date_12-05-2009__Time_15-54-2727\PID-4056__CCNET.EXE__2nd_chance_NET_CLR__full_13d0_2009-12-06_00-32-58-375_0fd8.dmp]
User Mini Dump File with Full Memory: Only application data is available

Comment: '2nd_chance_NET_CLR_exception_in_CCNET.EXE_running_on_TEST218'
Symbol search path is: srv*
Executable search path is:
Windows Server 2003 Version 3790 (Service Pack 2) MP (2 procs) Free x64
Product: Server, suite: Enterprise TerminalServer SingleUserTS
Machine Name:
Debug session time: Sun Dec  6 00:33:00.000 2009 (GMT+8)
System Uptime: 32 days 12:43:50.773
Process Uptime: 0 days 8:44:23.000
..........................WARNING: mscorjit overlaps mscoree
..............................WARNING: wldap32 overlaps dnsapi
........
..WARNING: rasapi32 overlaps dnsapi
...WARNING: tapi32 overlaps rasapi32
.WARNING: rtutils overlaps rasman
..............WARNING: setupapi overlaps winsta
....
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(fd8.15fc): CLR exception - code e0434f4d (first/second chance not available)
wow64!Wow64NotifyDebugger+0x9:
00000000`6b006369 b001            mov     al,1

wow64,这里给了点啥说法呢,在我们的32bit程序中的64bit部分,那么我应该只关心32bit部分去:

0:025> !load wow64exts
0:025> !sw
Switched to 32bit mode
0:025:x86> !clrstack
OS Thread Id: 0x15fc (25)
Failed to start stack walk: 80070057
0:025:x86> !threads
ThreadCount: 36
UnstartedThread: 0
BackgroundThread: 15
PendingThread: 0
DeadThread: 0
Hosted Runtime: no

正常了,这样就可以继续了:

0:025:x86> kb
ChildEBP RetAddr  Args to Child             
07c9f10c 79eda99c e0434f4d 00000001 00000001 kernel32!RaiseException+0x53
07c9f16c 7a097d91 0fd28d98 00000000 00000000 mscorwks!RaiseTheExceptionInternalOnly+0x2a8
07c9f184 7a097e03 0fd28d98 00000000 07c9f30c mscorwks!RaiseTheException+0x4e
07c9f1ac 7a097e34 00000000 06246750 f1880ba3 mscorwks!RaiseTheException+0xc0
07c9f1d8 7a097e42 0fd28d98 00000000 07c9f318 mscorwks!RealCOMPlusThrow+0x30
07c9f1e8 7a1080af 0fd28d98 53e77d3f 79f38888 mscorwks!RealCOMPlusThrow+0xd
07c9f318 7a10a245 00000000 07c9f350 07c9f3c0 mscorwks!Thread::RaiseCrossContextException+0x41f
07c9f3cc 79fd882b 00000002 79fd87f6 07c9f4c4 mscorwks!Thread::DoADCallBack+0x2a2
07c9f3e8 79e9846b 07c9f4c4 07c9f470 79f7762b mscorwks!Thread::DoADCallBack+0x310
07c9f47c 79e98391 07c9f4c4 53e77a9f 00000000 mscorwks!Thread::ShouldChangeAbortToUnload+0xe3
07c9f4b8 79e9851d 07c9f4c4 00000002 00000000 mscorwks!Thread::ShouldChangeAbortToUnload+0x30a
07c9f4e0 79f3d654 00000002 79f3d769 07c9f550 mscorwks!Thread::ShouldChangeAbortToUnload+0x33e
07c9f4f8 79f3d72e 00000002 79f3d769 07c9f550 mscorwks!ManagedThreadBase::KickOff+0x13
07c9f594 79f920a5 06246df8 07c9f5d4 7d6251f0 mscorwks!ThreadNative::KickOffThread+0x269
07c9ffb8 7d4dfe37 062397e8 00000000 00000000 mscorwks!Thread::intermediateThreadProc+0x49
07c9ffec 00000000 79f9205f 062397e8 00000000 kernel32!BaseThreadStart+0x34
0:025:x86> !pe
Exception object: 000000000fd28d98
Exception type:
System.Threading.ThreadInterruptedException
Message: Thread was interrupted from a waiting state.
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80131519
0:025:x86> !do 000000000fd28d98
Name: System.Threading.ThreadInterruptedException
MethodTable: 000000007994f930
EEClass: 00000000791721c4
Size: 72(0x48) bytes
(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
0000000079330a00  40000b5        4        System.String  0 instance 000000000fd29c3c _className
000000007932fe74  40000b6        8 ...ection.MethodBase  0 instance 0000000000000000 _exceptionMethod
0000000079330a00  40000b7        c        System.String  0 instance 000000000fd2a260 _exceptionMethodString
0000000079330a00  40000b8       10        System.String  0 instance 000000000fd29d94 _message
000000007932a35c  40000b9       14 ...tions.IDictionary  0 instance 0000000000000000 _data
0000000079330b94  40000ba       18     System.Exception  0 instance 0000000000000000 _innerException
0000000079330a00  40000bb       1c        System.String  0 instance 0000000000000000 _helpURL
000000007933061c  40000bc       20        System.Object  0 instance 0000000000000000 _stackTrace
0000000079330a00  40000bd       24        System.String  0 instance 0000000000000000 _stackTraceString
0000000079330a00  40000be       28        System.String  0 instance 000000000fd2ab34 _remoteStackTraceString
0000000079332c4c  40000bf       34         System.Int32  1 instance        0 _remoteStackIndex
000000007933061c  40000c0       2c        System.Object  0 instance 0000000000000000 _dynamicMethods
0000000079332c4c  40000c1       38         System.Int32  1 instance -2146233063 _HResult
0000000079330a00  40000c2       30        System.String  0 instance 000000000fd2a4c8 _source
00000000793332c8  40000c3       3c        System.IntPtr  1 instance 367c6d400000000 _xptrs
0000000079332c4c  40000c4       40         System.Int32  1 instance        0 _xcode
0:025:x86> !do 000000000fd2ab34
Name: System.String
MethodTable: 0000000079330a00
EEClass: 00000000790ed64c
Size: 772(0x304) bytes
(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
String:    at System.Threading.Thread.SleepInternal(Int32 millisecondsTimeout)
   at
ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Run()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
0000000079332c4c  4000096        4         System.Int32  1 instance      378 m_arrayLength
0000000079332c4c  4000097        8         System.Int32  1 instance      377 m_stringLength
00000000793316e0  4000098        c          System.Char  1 instance       20 m_firstChar
0000000079330a00  4000099       10        System.String  0   shared   static Empty
    >> Domain:Value  00000000002e7e68:0000000002731198 00000000003157a0:0000000002731198 <<
0000000079331630  400009a       14        System.Char[]  0   shared   static WhitespaceChars
    >> Domain:Value  00000000002e7e68:000000000273176c 00000000003157a0:0000000002733938 <<

好,查看一下ProjectIntegrator::Run方法:

   1:          /// <summary>
   2:          /// Main integration loop, intended to be run in its own thread.
   3:          /// </summary>
   4:          private void Run()
   5:          {
   6:              Log.Info("Starting integrator for project: " + project.Name);
   7:              try
   8:              {
   9:                  // loop, until the integrator is stopped
  10:                  while (IsRunning)
  11:                  {
  12:                      try
  13:                      {
  14:                          Integrate();
  15:                      }
  16:                      catch (Exception ex)
  17:                      {
  18:                          Log.Error(ex);
  19:                      }
  20:                      // sleep for a short while, to avoid hammering CPU
  21:                      Thread.Sleep(100);
  22:                  }
  23:              }
  24:              catch (ThreadAbortException)
  25:              {
  26:                  // suppress logging of ThreadAbortException
  27:                  Thread.ResetAbort();
  28:              }
  29:              finally
  30:              {
  31:                  Stopped();
  32:              }
  33:          }
 
To be continued …

posted @ 2009-12-20 23:17 new 维生素C.net() 阅读(65) | 评论 (0)编辑

2009年12月5日 #

IExtensibleObject<ExtensibleHttpApplication>的性能问题

     摘要: 使用IExtensibleObject<ExtensibleHttpApplication>的时候,注意到 看一下ExtensionCollection<T> 的实现方式,注意,从SynchronizedCollection<IExtension<T>>继承: public sealed class ExtensionCollection<T&...  阅读全文

posted @ 2009-12-05 12:37 new 维生素C.net() 阅读(32) | 评论 (0)编辑

2009年11月3日 #

TFS硬件要求

     摘要: Team要有自己独立的TFS Server了,据传是DELL PowerEdge R710:2U,2*Xeon 5504 2G Gainestown 45nm, DDR3 12GB, 2*146GB SAS, 2*1000MBps Ethenet 终于要告别现在蜗牛般的2850了! 根据微软的建议: #Developers Configuration CPU RAM* HDD** <= 2...  阅读全文

posted @ 2009-11-03 00:08 new 维生素C.net() 阅读(63) | 评论 (0)编辑

2009年10月27日 #

在x64系统上安装多个ccnet

     摘要: 首先,要保证vsts插件在x64系统上可以正常工作,需要先: corflags /32bit+ ccnet.execorflags /32bit+ ccservice.exe corflags工具在C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin可以找到 否则应该看到如下的报错: System.IO.FileNotFoundExceptio...  阅读全文

posted @ 2009-10-27 13:38 new 维生素C.net() 阅读(85) | 评论 (0)编辑

2009年10月21日 #

web.config里使用configSource需要注意的

     摘要: 使用restartOnExternalChanges避免monitor thread监视对外部文件更改的thread,这种thread多了对性能是有影响的  阅读全文

posted @ 2009-10-21 09:47 new 维生素C.net() 阅读(86) | 评论 (0)编辑