Samples not working

Feb 25, 2009 at 6:40 AM
I downloaded the current release . The sample given is not working . I am using windows vista ultimates(IIS7). When i try to run the application IIS7 throws an error saying there is an error in web.config. saying that NWSGI not able to find.
Coordinator
Feb 25, 2009 at 7:39 PM
Hi py_sunil,
Cn you post the web.config you are using as well as the exact error message you get? Also, did you use the MSI instaler or the zip file?
Feb 27, 2009 at 3:51 AM

Hi,

This is Sunil Pottumuttu.

I downloaded the zip file.

These are the steps i followed

STEP 1:
--------
created virtual directory in IIS pointing to the "Helloworld' directory.

STEP 2:
--------

copied the following files to "Helloworld\bin" directory
IronPython.dll
IronPython.Modules.dll
Microsoft.Scripting.Core.dll
Microsoft.Scripting.dll
Microsoft.Scripting.ExtensionAttribute.dll
NWSGI.dll

STEP 3:
--------

copied the following files to "helloworld"  directory

helloword.wsgi
"web.classic.config" by renaming as "web.config"

here is the web.config file contents

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="wsgi" type="NWSGI.WsgiSection" />
    </configSections>

    <wsgi />
   
    <system.web>
        <compilation debug="true" />

        <httpHandlers>
            <add verb="*" path="*.wsgi" type="NWSGI.WsgiHandler" />
        </httpHandlers>
    </system.web>
    <system.webServer>
        <handlers>
            <add name="WsgiHandler" path="*.wsgi" verb="*" type="NWSGI.WsgiHandler, NWSGI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86" resourceType="Unspecified" />
       
        </handlers>
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>
</configuration>

STEP 4:
--------

In Internet explorer navigated to the following url http://localhost/HelloWorld/hello.wsgi

i got the following error

Here is the error. do i need to do any thing.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'NWSGI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'NWSGI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86' or one of its dependencies. The system cannot find the file specified.

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. 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'NWSGI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'NWSGI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +78
   System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +51
   System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +18
   System.Web.Configuration.HandlerFactoryCache..ctor(String type) +16
   System.Web.HttpApplication.GetFactory(String type) +56
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161

 

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434 

 

 

STEP 5:
------

since i got error
I tried the same thing by copying "web.integrated.config" by renaming as "web.config"

then i got the following error

Server ErrorInternet Information Services 7.0

Error Summary

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error InformationModule IIS Web Core

Detailed error information

Notification BeginRequest
Handler Not yet determined
Error Code 0x8007000d
Config Error The configuration section 'wsgi' cannot be read because it is missing a section declaration 
Config File \\?\C:\work\HelloWorld\web.config
Requested URL http://localhost:80/HelloWorld/hello.wsgi
Physical Path C:\work\HelloWorld\hello.wsgi
Logon Method Not yet determined
Logon User Not yet determined

 Config Source
    3:     <system.webServer>
    4:         <wsgi />
    5:        
 Links and More InformationThis error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
View more information »

what should i do to rectify this error...?

Thanks & regards,
Sunil Pottumuttu

Coordinator
Mar 3, 2009 at 12:19 AM
Edited Mar 3, 2009 at 12:22 AM
Hi Sunil,
Web.Integrated.config is only applicable is you use the MSI installer, so you'll have to use the Classic configuration.

I ran through the same steps you did, but I was unable to reproduce the problem. However, my machine isn't the best test platform - I could easily have changed some setting and forgot to document it.

I could reproduce the problem by deleting NWSGI.dll from HellowWorld\bin; could you double-check that NWSGI.dll is in there? Also, I've seen that error before when a file is the wrong version; you can check this by looking at the "Version" tab of NWSGI.dll's properties - it should say 1.0.0.0 for both "File Version" and "Program Version".

If neither of those are the issue, could you please make a zip file of the HelloWorld folder as it exists on your machine and attach the zipfile to the issue? That way I can take a look at exactly what you are doing.

P.S. Thanks for the detailed bug report; it really helps to have all of that information available.
Coordinator
Mar 3, 2009 at 12:21 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.