If you are experienced with WCF, you know that in case of installing IIS after installing .NET framework, you need to register ASP.NET using aspnet_regiis.exe with /i option from “%windir%\Microsoft.NET\Framework\v2.0.50727” and WCF handler modules  using ServiceModelReg.exe /i which is found at “%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation”.

That’s true for .NET 3.0 and 3.5SP1, but if you tried this while developing for WCF 4.0 (or WCF Data Services 4.0 which is also WCF service) you will face the following error whenever trying to browse your service

“HTTP Error 500.21 - Internal Server Error
Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list”

Or the this one

“The current identity (IIS APPPOOL\ASP.NET V4.0) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.”

And you may face the following error while running aspnet_regiis /i from the command line

“Operation failed with 0x8007000B    An attempt was made to load a program with an incorrect format.”

That’s because there are new versions for both executables to register ASP.NET and WCF 4.0 for both x86 and x64 platforms.

In case that you are targeting .NET 4.0 on x86 platforms even if you are developing using x64 machine, then  you need to do the following steps
Use the corresponding x86 executables for .NET 4.0 found at “%windir%\Microsoft.NET\Framework\v4.0.30319”
Enable 32 bit mode for all IIS Application Pools using the command
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true

In case that you are targeting .NET 4.0 on x64 platforms, then  you need to do the following steps
Use the corresponding x64 executables found at “%windir%\Microsoft.NET\Framework64\v4.0.30319”
Update your project to reference the x64 DLLs found at “Program Files\Reference Assemblies\Microsoft\Framework” instead of the x86 versions which is referenced by default from “Program Files(x86)\Reference Assemblies\Microsoft\Framework”

I hope this saves you those painful troubleshooting times that I’ve to go through :(

Have a nice day

posted @ 2011-04-10 12:33 乌卡卡 阅读(58) 评论(0) 编辑

Network access for Distributed Transaction Manager (MSDTC) has been disabled

System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. —> System.Runtime.InteropServices.COMException (0x8004D024): The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)

You can resolve this by following the steps below

Control Panel – Administrative Tools – Component Services – My Computer properties – MSDTC tab – Security Configuration tab – Network DTC Access (checked) / Allow Remote Clients (checked) / Allow Inbound (checked) / Allow Outbound (checked) / Enable TIP Transactions (checked)

 

 

FROM:http://hspinfo.wordpress.com/2009/03/24/network-access-for-distributed-transaction-manager-msdtc-has-been-disabled/

posted @ 2011-04-06 13:09 乌卡卡 阅读(37) 评论(0) 编辑

<style type="text/css">
<!--
* {margin:0;padding:0}
div {
  width:500px;
  height:500px;
  border:1px solid #666;
  overflow:hidden;
  position:relative;
  display:table-cell;
  text-align:center;
  vertical-align:middle
}
div p {
  position:static;
  +position:absolute;
  top:50%
  }
img {
  position:static;
  +position:relative;
  top:-50%;left:-50%;
  }
-->
</style>
<div><p><img src="http://www.google.com/intl/en/images/logo.gif" /></p></div>

posted @ 2011-03-20 21:55 乌卡卡 阅读(24) 评论(0) 编辑

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>鼠标经过图片半透明效果,支持Firefox/IE</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
      body {background:#000;}
      .img_link{filter:alpha(opacity=50); /* IE */
            -moz-opacity:0.5; /* Moz + FF */
            opacity:0.5; /* 支持CSS3的浏览器(FF 1.5也支持)*/
          }
      .img_link:hover {
            filter:alpha(opacity=100); /* IE */
            -moz-opacity:1; /* Moz + FF */
           opacity:1; /* 支持CSS3的浏览器(FF 1.5也支持)*/
           }
    </style>
  </head>
  <body>
   <img class="img_link" src="http://www.tmxhx.com/attachments/month_0808/k2008823103739.jpg" alt="测试效果"  onMouseOver="this.className='null'" onMouseOut="this.className='img_link'" />
  </body>
</html>

posted @ 2011-03-20 20:27 乌卡卡 阅读(5) 评论(0) 编辑

Sub AttachToCalc()
           Try

Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger

Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")

Dim dbgeng(1) As EnvDTE80.Engine

dbgeng(0) = trans.Engines.Item("Native")

Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "JIMSMACHINE").Item("calc.exe")

proc2.Attach2(dbgeng)

Catch ex As System.Exception

MsgBox(ex.Message)

End Try

End Sub

posted @ 2011-03-19 22:02 乌卡卡 阅读(12) 评论(0) 编辑

今天在使用asp.net 2005中的 Login控件時,用到了Asp.net web site 管理工具 。在進行用戶管理時,Security頁面總是提示連不到Sql ,在網上翻了個把小時後,終於解決,下面就帖出原文。

1.将ASP.NET中的membership应用到sqlserver2000/sqlserver2005中

默认情况下membership在安装了 Sql Server Express 的情况下才能用,但是在多情况下我们的项目中已经有了自己的数据库,可能在sqlserver2000或者sqlserver2005,这时我们应当如何来使用membership所提供的功能呢?

这个时候,就要手动地进行MemberShip的配置工作了。利用aspnet_regsql.exe这个工具就可以。

首先,打开“Visual Studio 2005 命令提示”(在VS2005菜单里面的Visual Studio Tools里面能找到),运行aspnet_regsql.exe这个工具。然后按照屏幕提示,初始化数据库。

打开asp.net sqlserver安装向导:

如上图,配置好您的数据库服务器与数据库。

OK,打开数据库看下,如下图所示,已经安装了membership所需要的表:

完成数据库的初始化工作之后,就需要对Web.Config进行相应配置。

2.Web.Config 文件配制 (重點)

<connectionStrings>
    <add name="constrU" connectionString="server=.;database=aspnetdb;uid=sa;pwd=sa" providerName="System.Data.SqlClient" />
</connectionStrings>

    <system.web>
      <membership defaultProvider="AspNetSqlMP">
        <providers>
          <add name="AspNetSqlMP"
                    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    connectionStringName="constrU"
               enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        applicationName="/"
        requiresUniqueEmail="false"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="5"
        minRequiredPasswordLength="6"
        minRequiredNonalphanumericCharacters="0"
        passwordAttemptWindow="10"
        passwordStrengthRegularExpression="" />
        </providers>
      </membership>

<system.web>

<!--
    connectionStringName 数据库连接。这个要在web.config设置
    enablePasswordRetrieval 获得一个值,指示当前成员资格提供程序是否配置为允许用户检索其密码。
    enablePasswordReset 获得一个值,指示当前成员资格提供程序是否配置为允许用户重置其密码。
    requiresQuestionAndAnswer 获取一个值,该值指示默认成员资格提供程序是否要求用户在进行密码重置和检索时回答密码提示问题。
    applicationName 获取或设置应用程序的名称。
    requiresUniqueEmail 指示用户在创建用户时是否必须提供唯一的电子邮件地址值。
    passwordFormat 指示在成员资格数据存储区中存储密码的格式。下面有详细说明
    maxInvalidPasswordAttempts 获取锁定成员资格用户前允许的无效密码或无效密码提示问题答案尝试次数。
    minRequiredPasswordLength 获取密码所要求的最小长度。
    minRequiredNonalphanumericCharacters 获取有效密码中必须包含的最少特殊字符数。
    passwordAttemptWindow 获取在锁定成员资格用户之前允许的最大无效密码或无效密码提示问题答案尝试次数的分钟数。

    对PasswordFormat 的详细说明
    属性指示存储密码的格式。密码可以采用 Clear、Encrypted 和 Hashed 密码格式存储。Clear 密码以明文形式存储,这可以提高存储和检索密码的性能,但安全性较差,当数据源安全性受到威胁时此类密码很容易被读取。Encrypted 密码在存储时进行了加密,可以在比较或检索密码时进行解密。此类密码在存储和检索时需要进行额外的处理,但比较安全,在数据源的安全性受到威胁时不容易被获取。Hashed 密码在存储到数据库时使用单向哈希算法和随机生成的 salt 值进行哈希处理。在验证某一密码时,将用数据库中的 salt 值对该密码进行哈希计算以进行验证。无法检索哈希密码。
    -->

 

<membership>
          <providers>
              <clear/>
              <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="conn"
                   enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                   maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                   applicationName="/" />
          </providers>
      </membership>
      <profile>
          <providers>
              <clear/>
              <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="conn" applicationName="/" />
          </providers>
      </profile>

      <roleManager enabled="true" >
          <providers>
              <clear/>
              <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="conn" applicationName="/" />
              <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
          </providers>
      </roleManager>

posted @ 2011-02-26 16:37 乌卡卡 阅读(44) 评论(0) 编辑
摘要: 浏览器符号IE6IE7IE8FF*√√××!important×√×√_√×××\9××√×*html√×××*+html×√××阅读全文
posted @ 2010-09-27 23:29 乌卡卡 阅读(6) 评论(0) 编辑
摘要: 今天把一个MSSQL的数据库转成MYSQL,在没有转换工具的情况下,对于字段不多的数据表我用了如下手功转换的方法,还算方便。MSSQL使用企业管理器操作,MYSQL用phpmyadmin操作。  1.用MSSQL企业管理器,打开表的结构(设计表),本地用phpmyadmin根据结构一个一个创建,同时优化了一下表数据字段,表创建完成。  2.用企业管理器导出单表,导入源选择文本,分隔符选择;,原为'...阅读全文
posted @ 2010-06-06 15:37 乌卡卡 阅读(28) 评论(0) 编辑
摘要: TreeNode.SelectAction = TreeNodeSelectAction.Expand即可阅读全文
posted @ 2010-01-20 23:44 乌卡卡 阅读(67) 评论(0) 编辑
摘要: 真晕啊,还没研究原因阅读全文
posted @ 2010-01-05 23:54 乌卡卡 阅读(9) 评论(0) 编辑