p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   Trouble with IIS 7.5:Should I uninstall and Reinstall it? (http://p2p.wrox.com/showthread.php?t=90817)

maurices5000 September 2nd, 2013 03:47 AM

Trouble with IIS 7.5:Should I uninstall and Reinstall it?
 
I'm having problems with IIS 7.5. I bought this book after a recommendation i got days ago. I noticed the book has instruction in it, thankfully, about configuring IIS. I've never used IIS until recently. I followed a previous book's instructions on how to get it going but it did not work and I've tried getting help at iis.net to no avail. So I'm wondering if I should just start over and follow the instructions in this book.

I have Windows 7 Home Premium. I have a simple app that uses AdventureWorks database. I have Developers Edition of SSMS 2010 and 2012. It was working before I tried to deploy it using IIS but now it is not work. I was hoping that starting from scratch and doing the steps in this book might help.

Thanks!

Oleg Kolpashchikov September 2nd, 2013 01:29 PM

If your app works properly within Visual Studio (on "development web server") and you have problems only with or after deployment to IIS, then the process of deployment is what you have to pay attention to.
IIS is a "feature" of Windows and you do not have to re-install it. Although, you might need to "check" some boxes in the Control Panel to make IIS work together with ASP.NET or may be run aspnet_regiis.exe

Please be more specific with what you mean by "I'm having problems"

maurices5000 September 2nd, 2013 02:22 PM

Thanks for your help. I greatly appreciate it. I've been working on this for days and I'm very frustrated. You have to forgive me. it is hard knowing how to articulate the problem I'm having. IIS and getting the database to cooperate isn't the main focus of my book; it is only mention in passing.

Q1) How do i verify that my app still runs in VS development server? When I run it now it automatically tries to use IIS. I don't think anything is wrong with the app but after a while i started getting an new error message. I'm assuming the problem is still with IIS and not some mistake i made because i would have seen a * by the tab indicating something had changed. (I'm more concerned about getting IIS up and running so if this is too much just don't worry.)

Q2) I went to RUN on the start menu and typed aspnet_regiis.exe but i got an error. Is this what you intended for me to do?

The book that i used to develop the WCF services gives these clues or notes:

"If the [end point] address is correct but the application still fails, the most likely cause is that the account used by the application pool hosting the service does not have appropriate access to the AdventureWorks database. The account must be a member of the db_owner role in the AdventureWorks database. For examples of how to add an account with this privilege to the database, see the aspnet.sql script in the Microsoft Press\ WCF Step By Step\ Setup folder."

Well I did what the book said up to this point and I dont know what the problem is.

Below is the script it was talking about aspnet.sql. I did check and the database does have those users and roles.

Quote:

USE [AdventureWorks]
GO
CREATE USER [IIS APPPOOL\DefaultAppPool] FOR LOGIN [IIS APPPOOL\DefaultAppPool]
GO
EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\DefaultAppPool]
GO
GO
CREATE USER [IIS APPPOOL\ASP.NET v4.0] FOR LOGIN [IIS APPPOOL\ASP.NET v4.0]
GO
EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\ASP.NET v4.0]
GO
I am using the "ASP.NET v4.0" appliation pool. I don't know if that helps.

In IIS when i click on my site and click Basic Setting in the right panel, i get an Edit Application window. There I see the path: C:\inetpub\wwwroot\ProductsService along with two buttons Connect as... and Test Settings... Connect As... is set to Application User (Pass-through authentication). When i press Test AS... I get an error: "There was an error while performing this operation. Details: Invalid application path." When i use my own name with admin access, it is ok. But my app still does not work.

Someone on another forum said i needed to add permissions for IUSR and Network Service to the C:\inetpub\wwwroot\ProductsService. So i gave them full access.

Nothing is still working.

The latest error that I'm getting in the application's Test Console is:

Test 1: List all products

Test 2: Display the details of a product

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at ProductsClient.Program.Main(String[] args) in C:\Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Progr am.cs:line 38
Press any key to continue . . .

The original error was (I don't know if either of these are helpful are provide any additional information but I'm posting so you can see):

Test 1: List all products

Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:00:58.8749356. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to'http://localhost/ProductsService/Service.svc' has exceeded the allotted timeout of 00:00:59.0370000. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out

at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.Ht tpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.HttpChannelUtilities. ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.Ht tpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Reques t(Message message, TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.RequestChannel.Reques t(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinde r.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at ProductsClient.ProductsService.IProductsService.Li stProducts()
at ProductsClient.ProductsService.ProductsServiceClie nt.ListProducts() in C:\
Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Servi ce References\ProductsService\Reference.cs:line 154
at ProductsClient.Program.Main(String[] args) in C:\Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Progr am.cs:line 22
Press any key to continue . . .

Imar September 2nd, 2013 02:30 PM

Are you sure you posted in the correct book category? The errors you are getting seem to be related to WCF which is discussed only briefly in my book.
Quote:

I went to RUN on the start menu and typed aspnet_regiis.exe but i got an error. Is this what you intended for me to do?
aspnet_regiis.exe by itself does nothing. In order to (re)register ASP.NET with IIS, you need to run it from a command line (running as an Administrator) from the correct .NET folder and pass it the -i parameter. Page 749 of my book has more information on this.

Cheers,

Imar

maurices5000 September 2nd, 2013 02:34 PM

Also I'm using the Entity Model instead of a direct connection to the AdventureWorks database.

Here is my Endpoint
Quote:

<endpoint address="http://localhost/ProductsService/Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductsSe rvice"
contract="ProductsService.IProductsService" name="BasicHttpBinding_IProductsService" />
Here is my connection string:
Quote:

<connectionStrings>
<add name="AdventureWorksEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=System.Data.SqlClient;p rovider connection string=&quot;data source=SAM;initial catalog=AdventureWorks;integrated security=True;multipleactiveresultsets=True;App=En tityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

maurices5000 September 2nd, 2013 02:36 PM

Quote:

Originally Posted by Imar (Post 293458)
Are you sure you posted in the correct book category? The errors you are getting seem to be related to WCF which is discussed only briefly in my book.

Cheers,

Imar

Well i was trying to find out if i needed to uninstall IIS and just follow what you said in your book. Nothing else seems to be working.
I got your ebook. I did a search for aspnet_regiis.exe and could not find it. I'm checking online to see which chapter corresponds with that page number.

Thanks.

maurices5000 September 2nd, 2013 02:51 PM

The book says: "If you already had the .NET Framework 4.5 on your machine and installed IIS afterward, you need to tell IIS about the existence of the framework. Normally, this is done during installation of the .NET Framework, but if you installed IIS later, you need to do this manually. You only need to do this on Windows 7 and Server 2008 R2."

OK this makes sense. (I plan was to use 4.5 but my WCF book is 4.0 however). I can download and install Visual Studio 2012 from my student account but I'm not sure it will help for 4.0)

I'm going to continue reading. thanks

Imar September 2nd, 2013 03:10 PM

Quote:

I can download and install Visual Studio 2012 from my student account but I'm not sure it will help for 4.0)
You don't need it to deploy. All you need is a separate download for ASP.NET to run on your server.

Quote:

I did a search for aspnet_regiis.exe and could not find it.
Search for aspnet_regiis without the .exe and you should find it in Chapter 19.

However, I am not sure you have an ASP.NET problem. You seem to be having WCF issues instead. However, since I don't know your setup (e.g. which end of the WCF service is causing the issue), it's hard to say.

Maybe you can describe your setup in a bit more detail?

Imar

maurices5000 September 2nd, 2013 03:34 PM

Thanks for your help. I did find the information. I've read thought it. I don't think the problem is with ASP.NET either.

Because I'm a complete novice, I really don't know what else to tell you other than the error I listed above. I have this book and my WCF book but unlike you, the author of the WCF doesn't discuss alternative courses of action.

I'm getting ready to read your "Understanding Security in IIS" section in the book to see if that might help.

I really didn't think this should be so hard. The author of the WCF book simply doesn't address this at all. He only assumes it should work.

If you can think up some questions that might shed some light, i'll do what i can to answer them.

(If I knew it was going to be this hard I would have told my professor I was going to stick with ASP.NET but i'm committed to getting WCF working now.)

Thanks!

Imar September 2nd, 2013 03:57 PM

Quote:

I really didn't think this should be so hard.
IMO, configuring WCF can be really hard, with lots of different error messages that can come from many different configuration issue..... ;-(

Quote:

If you can think up some questions that might shed some light, i'll do what i can to answer them.
Describe your setup. That is, describe the site in IIS, settings for your app pool, your config file, how you can connect to the WCF service and where and when you get the error message. When you set up WCF it acts as a server. In order for it to be useful, you need another application (or the same site in IIS if you're consuming the service locally) to acts as a client. The issue could be on both ends, but right now I can't tell which one is causing the issue.

Cheers,

Imar


All times are GMT -4. The time now is 08:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.