Friday, November 5, 2010

CustomBinding binaryMessageEncoding error, Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

this is an Issue about the WCF Bindings. By default, if you use wshttpbinding or httpbinding, The http channel will use the Text based encoding which is not very efficient in terms of the network transfer.  however, you can combine one custombing, just pick up the binaryencoding which is been used by tcpbinding, and httptransfer as the transport channel.

you can create one customBinding like this,

<customBinding>
       <binding name="csbinding">

         <binaryMessageEncoding>
         </binaryMessageEncoding>

         <httpTransport>
         </httpTransport>

       </binding>
     </customBinding>


if the service is hosted in IIS, and the anonymous access for this folder has been turned off.  you may get the follow error when you try to access the svc. even just the wsdl access.


erver Error in '/DemoWCF' Application.

Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.]
System.ServiceModel.Channels.HttpChannelListener.ApplyHostedContext(VirtualPathExtension virtualPathExtension, Boolean isMetadataListener) +11449553
System.ServiceModel.Activation.VirtualPathExtension.ApplyHostedContext(TransportChannelListener listener, BindingContext context) +75
System.ServiceModel.Channels.HttpTransportBindingElement.BuildChannelListener(BindingContext context) +119
System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener() +66
System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener(BindingContext context) +67
System.ServiceModel.Channels.BinaryMessageEncodingBindingElement.BuildChannelListener(BindingContext context) +46
System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener() +66
System.ServiceModel.Channels.Binding.BuildChannelListener(Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters) +124
System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener& result, Boolean supportContextSession) +337
System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result) +647
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +1364
System.ServiceModel.ServiceHostBase.InitializeRuntime() +37
System.ServiceModel.ServiceHostBase.OnBeginOpen() +27
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/DemoWCF/Service.svc' cannot be activated due to an exception during compilation. The exception message is: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service..]
System.ServiceModel.AsyncResult.End(IAsyncResult result) +11527290
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75




for the fix. just right click the .svc file in IIS and enable the anonymous access.

Tutorial , Firebug , Free Commercial IE httpwatch alternative

HttpWatch is a great Commercial Tool to capture the Http traffic, enable admin to do the user end http analysis. like check the Cache is correct, client did get the Gzip version response. If you are looking for a free alternative.  FireBug for fixfox is my top choice.  Here is a basic tutorial one Firebug.

Install Firebug on Firefox.
Click tools->add-ons, search firebug. click to install the add-on and restart firefox.

image

After loaded the firebug, Open Firefox, press F12 or click add-ons to turn it on.

View the Http Request /Response Header. Click the dropdown arrow to enable the traffic capturing.
image

When you access Wikipedia mainpage, http://en.wikipedia.org/wiki/Main_Page, you will see the resource get requested to web servers. and the timeline.

image

click one url , i.e the first one. you can tell the server is apache, the wiki used Cache heavily. here the cache could be squid or varnish.  the we do get the gzip version response.

image 
scroll down, you can see the request header the firefox is sending out.
image

If you press Shift and click the refersh in firefox. you will see that the firefox tell the edge server to reload th request and never pickup the cached version.
image

in the HTML tab, click the pointer to a object like the logo here., you can see the img url and css styles.
image

Tuesday, October 26, 2010

asp.net mvc, CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

after I located the Entity framework connection string, Unable to load the specified metadata resource. continued reading the professional asp.net mvc 2 to page 48. When I try to run the details page. /controller/details/validid
get the following error,

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Source Error:

Line 170:
Line 171: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 172: public class views_dinners_details_aspx : System.Web.Mvc.ViewPage<LADinner.Models.Dinner>, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
Line 173:
Line 174: private static bool @__initialized;

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_Web_details.aspx.32d6c807.yjqx_sl8.0.cs    Line: 172
the stack trace shows when runtime try to compile the .aspx page using the csc.exe, missed one assembly reference System.Data.Entity.

then I click the detailed compiler output  , I get the following outputs. and Highlighted the System.Data.X assemblies. the error is right, there is no reference to System.Data.Entity.

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_global.asax.4lhx-qfz.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_Web_3rrpychx.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Abstractions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Abstractions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\assembly\dl3\452a723b\f0bfe800_2e75cb01\NerdDinner.DLL"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll"
/R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Routing.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_Web_details.aspx.32d6c807.yjqx_sl8.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_Web_details.aspx.32d6c807.yjqx_sl8.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f41f3cb9\3196a0b\App_Web_details.aspx.32d6c807.yjqx_sl8.1.cs"
Then I did some research. Though we added the assembly System.Data.Entity into our project. which means that those assembly are only for Runtime reference. For Compile time reference, We have to add the reference to System.web/Compilation/Assemblies in web.config, then the csc will pick up this settings

Like

<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</assemblies>
</compilation>

Monday, October 25, 2010

Troubleshooting Entity framework connection string, Unable to load the specified metadata resource.

I was reading the Book called Professional MVC 2 , following the tutorial to Page 44.

When I run the application, /Details/id, which will invoke the Entity framework to do a DB query. No luck, get an strange error.

Line 37:         /// Initializes a new nerdDinnerEntities object using the connection string found in the 'nerdDinnerEntities' section of the application configuration file.
Line 38:         /// </summary>
Line 39:         public nerdDinnerEntities() : base("name=nerdDinnerEntities", "nerdDinnerEntities")
Line 40:         {
Line 41:             this.ContextOptions.LazyLoadingEnabled = true;

[MetadataException: Unable to load the specified metadata resource.]
   System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +2490148
   System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +170
   System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +8517824
   System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths) +271
   System.Data.Common.Utils.<>c__DisplayClass2.<Evaluate>b__0() +19
   System.Data.Common.Utils.Result.GetValue() +100
   System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg) +181
   System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) +292
   System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() +29
   System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) +205
   System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +27
   LADinner.Models.LaDinnerEntities..ctor() in C:\NerdDinner\Models\LaDinners.Designer.cs:39
   LADinner.Models.DinnerRepository..ctor() in C:\NerdDinner\Models\DinnerRepository.cs:10
   LADinner.Controllers.DinnersController..ctor() in C:\NerdDinner\Controllers\DinnersController.cs:14

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
   System.Activator.CreateInstance(Type type) +6
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +491

[InvalidOperationException: An error occurred when trying to create a controller of type 'LADinner.Controllers.DinnersController'. Make sure that the controller has a parameterless public constructor.]
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +628
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +204
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +193
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +160
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +80
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +45
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841400
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Then I check the web.config.  the connection string is there.

<connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.;Integrated Security=SSPI;database=aspnetdb;trusted_connection=true" providerName="System.Data.SqlClient"/>
    <add name="NerdDinnerEntities" connectionString="metadata=res://*/NerdDinner.Models.NerdDinners.csdl|res://*/NerdDinner.Models.NerdDinners.ssdl|res://*/NerdDinner.Models.NerdDinners.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.;Initial Catalog=NerdDinner;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/></connectionStrings>

So the runtime will read some resource file embedded in the Assembly. So are the name correct?

I just run a ILDASM NerdDinner.DLL /out:a.il

c:\NerdDinner\bin>ildasm NerdDinner.dll /out:a.il

c:\NerdDinnerr\bin>dir
Volume in drive C is BOOTCAMP
Volume Serial Number is 7CA9-BE94

Directory of c:\NerdDinner\bin

10/25/2010  05:23 PM    <DIR>          .
10/25/2010  05:23 PM    <DIR>          ..
10/25/2010  05:23 PM           173,811 a.il
10/25/2010  05:23 PM               824 a.res
10/25/2010  05:19 PM            31,232 NerdDinner.dll
10/25/2010  05:19 PM            46,592 NerdDinner.pdb
10/25/2010  05:23 PM             2,298 Models.NerdDinners.csdl
10/25/2010  05:23 PM             1,205 Models.NerdDinners.msl
10/25/2010  05:23 PM             2,066 Models.NerdDinners.ssdl
               7 File(s)        258,028 bytes
               2 Dir(s)   5,624,713,216 bytes free

Here, for those resource file, Pay attantion to the filename. this is no Assmebly name as the prefix.
Models.NerdDinners.csdl Instead of NerdDinner.Models.NerdDinners.CSDL which is defined in the web.config

so remove the nerddinner in web.config , that’s the trick to fix the problem

<connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.;Integrated Security=SSPI;database=aspnetdb;trusted_connection=true" providerName="System.Data.SqlClient"/>
    <add name="NerdDinnerEntities" connectionString="metadata=res://*/NerdDinner.Models.NerdDinners.csdl|res://*/NerdDinner.Models.NerdDinners.ssdl|res://*/NerdDinner.Models.NerdDinners.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.;Initial Catalog=NerdDinner;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/></connectionStrings>

Friday, October 22, 2010

Microsoft wse kerberos an invalid security token was provided

there is one WSE secured service  which is authenticated using the Kerberos token.   someday, I get this error. “an invalid security token was provided”

the error is very general , that means the TGT ticket is somehow invalid. Could be caused by time inconsistency, host mismatch, tons of reasons.

So how to get more inside error. like the com return come?
run Cordbg, and attach to the w3wp process. turn on unhandled exception.

ca e
a xxxxx
print $exception

 image

Print the Inner Exception Exception
  

p $exception._innerException

image

Here we get the detailed error.

The incoming Kerberos service ticket could not be validated. The LsaLogonUser call failed with the following message: The trust relationship between this workstation and the primary domain failed.
form the wse manual, you can check the reason is that  when the Kerberos target host name does not match the host name of the Web service that receives the SOAP message. Change the target host name to match the host name of the Web service.

you may try rejoin the server to domain. for me, that’s because the client send two tgt token.

wse 2 sp1 think that’s fine that one soap with two tgt token. for sp3, it will denied the request and throw the above error.

Wednesday, October 20, 2010

Microsoft SQL Server 2008 Setup SQL Server 2008 Setup requires .NET Framework 3.5 to be installed.

I get an error today, when I try to install sql server 2008 on one windows server 2008. The .net Framework 3.5  is there already. you can tell from the folder. C:\windows\MIcrosoft.net\Framework

image

image

the SQL 2008 requires windows installer 4.5. (you can tell from run “msiexec /?”

image

Go to this link to install the latest windows installer. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5a58b56f-60b6-4412-95b9-54d056d6f9f4&displaylang=en

Then I go to %temp%, there is the setup log for sql server, also for all microsoft product. always check this folder for installation log.
there is one file called sqlsetup, here is the content.

10/20/2010 09:45:23.809 ======================================================================
10/20/2010 09:45:23.809 Setup launched
10/20/2010 09:45:23.809 Attempting to determine media source
10/20/2010 09:45:23.824 Media source value not specified on command line argument.
10/20/2010 09:45:23.824 Setup is launched from media directly so default the value to the current folder.
10/20/2010 09:45:23.824 Media source: E:\
10/20/2010 09:45:23.840 Attempt to determine media layout based on file 'E:\mediainfo.xml'.
10/20/2010 09:45:23.918 Media layout is detected as: Full
10/20/2010 09:45:23.934 Media LCID is detected as: 1033
10/20/2010 09:45:23.934 Local setup.exe not found, so continuing to run setup.exe from media.
10/20/2010 09:45:23.934 /? or /HELP or /ACTION=HELP specified: false
10/20/2010 09:45:23.949 Help display: false
10/20/2010 09:45:23.949 Checking to see if we need to install .Net version 3.5
10/20/2010 09:45:23.949 Determining the cluster status of the local machine.
10/20/2010 09:45:23.980 The local machine is not configured as a cluster node.
10/20/2010 09:45:23.996 Attempting to find media for .Net version 3.5
10/20/2010 09:45:23.996 Error: Cannot determine file version of .Net redist: 0x80004005
10/20/2010 09:51:44.615 .Net version 3.5 installation failed, so setup will close. Error code: 0x80004005
10/20/2010 09:51:44.631 Setup closed with exit code: 0x80004005
10/20/2010 09:51:44.631 ======================================================================

 

also I open the process monitor. to capture all fiel activity of setup.exe. , it try to read one setup file which is located in E:\x86\redist\DotNetFrameworks\dotNetFx35setup.exe

image

it’s not a valid PE file.

80004005 means  the file is broken.
so the final answer,  make sure you ISO checksum is correct. for me, just download a new ISO which works well.

Also Microsoft should prompt user a friendly error.

Monday, October 18, 2010

Install Squid cachemgr.cgi to IIS 7 (IIS comes with windows 7 or server 2008)

Copy the cachemgr.cgi to the IIS working folder.

1. turn on the CGI features for IIS 7 (Turn windows features on or Off )  , run “Optionalfeatures” in the command prompt.

image

after that, you should be able to see CGI in the IIS features set

image

2. add the handler mapping , Match extension .cgi file to cgi module. 
image

change the cgi permission to execute

image

3. setup permission to allow CGI execution.

Open the C:\Windows\System32\inetsrv\config\applicationHost.config, search isapiCgiRestriction Node.

<isapiCgiRestriction notListedIsapisAllowed="false” notListedCgisAllowed="True">

restart IIS. then you go.
image


FAQ,

If you see error

HTTP Error 404.3 - Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

you missed step 2

HTTP Error 404.2 - Not Found

The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
you missed step 3
 
Locations of visitors to this page