Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2013, 03:47 AM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default 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!
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2013, 01:29 PM
Authorized User
Points: 175, Level: 3
Points: 175, Level: 3 Points: 175, Level: 3 Points: 175, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Location: St.Petersburg, Russia
Posts: 36
Thanks: 1
Thanked 4 Times in 4 Posts
Default

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"
Reply With Quote
The Following User Says Thank You to Oleg Kolpashchikov For This Useful Post:
maurices5000 (September 2nd, 2013)
  #3 (permalink)  
Old September 2nd, 2013, 02:22 PM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

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 . . .
Reply With Quote
  #4 (permalink)  
Old September 2nd, 2013, 02:30 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
maurices5000 (September 2nd, 2013)
  #5 (permalink)  
Old September 2nd, 2013, 02:34 PM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

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>
Reply With Quote
  #6 (permalink)  
Old September 2nd, 2013, 02:36 PM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
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.

Last edited by maurices5000; September 2nd, 2013 at 02:42 PM..
Reply With Quote
  #7 (permalink)  
Old September 2nd, 2013, 02:51 PM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #8 (permalink)  
Old September 2nd, 2013, 03:10 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #9 (permalink)  
Old September 2nd, 2013, 03:34 PM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

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!
Reply With Quote
  #10 (permalink)  
Old September 2nd, 2013, 03:57 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't reinstall Access database Xzyl Access 6 November 18th, 2008 04:39 PM
MySQL - Uninstall Fix MySQL 2 April 12th, 2006 02:53 AM
Uninstall BETA's first Robert Reno BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 February 14th, 2006 12:50 PM
Trouble connecting to Access DB thru IIS swoopest Classic ASP Databases 6 November 10th, 2004 10:13 AM
MSDE Uninstall Doesn't jeffg22 SQL Server 2000 11 September 15th, 2004 09:11 AM



All times are GMT -4. The time now is 06:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.