Thank you for your help. The reason my application was breaking is because some of my views are hard coding the url, such as navigation buttons go to the URL "/Release/Add" so ive changed all the paths to read /controller.mvc/method
Im trying to make this work on my localhost and ive actually managed to get the application running a little for the first time. One problem im having is if i click on one of the links i get the following error:
Server Error in '/ReleaseTrackingSystem' Application.
Cannot open database "ReleaseTrackingSystem" requested by the login. The login failed.
Login failed for user 'VISHAL\ASPNET'.
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.Data.SqlClient.SqlException: Cannot open database "ReleaseTrackingSystem" requested by the login. The login failed.
Login failed for user 'VISHAL\ASPNET'.
How do you recon i can get over this? i understand its because the database isnt allowing the user. but can i change the user? or would you recommend adding this user?
Also if i click on another link which does not require database access i get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
hello again. error 1: the aspnet user hasn't got privileges for connecting to your sql database. when you were using the internal server, you didn't have that error because the vs web server was using your credentials to login. with iis, it'll use the credentials
of the account the app pool was configured to use (or, if you're in iiS 5, it'll use the account set up in the iis security tab). to solve this you can 1.) create an account for the aspnet user on your sql server db or 2.) change the connection string so that
it uses the credentials of a specific user that has the appropriate permissions. regarding the link error, can you put there the code you're using to set up the about link? it's clearly wrong, but I don't know how you're setting it up...
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
Marked as answer by vmb2000_uk on Jul 22, 2008 01:57 PM
And when i click the about link it is going back one step (getting rid of the "ReleaseTrackingSystem" from the URL and adding Home.mvc/About which causes it to break)
So I have updated my Default.aspx to "Response.Redirect("~/Home.mvc/Index")"
3) I then placed the source files in inetpub\wwwroot\
4) loaded IIS, and searched for the directory "ReleaseTrackingSystem" under default websites then went to the properties and created it as an application
5) checked that ASP.NET tab was set to 2.0
6) Followed a guide on the internet explaining how to get the default website to understand .mvc extentions
To do this i: went to the properties of the default website > Home Directory > Configuration > Added an extention with the same path as the .aspx but named it .mvc and unchecked "check that files exist"
7) SQL Server (my back end database) has been set up
8) i ran localhost/ReleaseTrackingSystem and it gives me the error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
If you typed the page address in the Address bar, make sure that it is spelled correctly.
Open the <script> </script> localhost home page, and then look for links to the information you want.
Ive found the reason to why its breaking. Just to let you know i am hard coding my URL's in my view because im not to sure if there are other ways.
yes, there are other ways. in fact, too many for me to describe them here :) anyways, I believe that the easiest way of getting the correct url is to use the UrlHelper class (notice that in the view you already have a property called Url which is of this type).
vmb2000_uk
nks
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
hello again. well, according to your descriptions, you're being redirected, but it seems like the routing isn't working. did you copy the routing assemblies to bin folder of your asp.net on the target machine? Have you tried running running http://..../home.mvc?
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
Im not 100% what you mean by the routing assemblies, all i did was copy the whole source code from my original laptop where i developed the application onto the target machine.
The code includes the bin folder and ive just checked and the bin folder has the following files:
Hello again. the routing assemblty is the system.web.routing.dll one more thing: make sure the version numbers of the assemblies you have on the web.config file match the version number of those assemblies you have on the bin folder. If you installed .net 3.5
SP1, you'll end up having 2 different versions of the routing assemblies and you must garantee that your web app ends up using the one that exists on the bin folder.
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
vmb2000_uk
Member
15 Points
35 Posts
Re: Hosting MVC Application on localhost
Jul 17, 2008 10:18 PM|LINK
Hi Luis,
Thank you for your help. The reason my application was breaking is because some of my views are hard coding the url, such as navigation buttons go to the URL "/Release/Add" so ive changed all the paths to read /controller.mvc/method
Im trying to make this work on my localhost and ive actually managed to get the application running a little for the first time. One problem im having is if i click on one of the links i get the following error:
Server Error in '/ReleaseTrackingSystem' Application.
Cannot open database "ReleaseTrackingSystem" requested by the login. The login failed.
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.Login failed for user 'VISHAL\ASPNET'.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database "ReleaseTrackingSystem" requested by the login. The login failed.
Login failed for user 'VISHAL\ASPNET'.
How do you recon i can get over this? i understand its because the database isnt allowing the user. but can i change the user? or would you recommend adding this user?
Also if i click on another link which does not require database access i get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Home.mvc/Index
The reason im getting this error is because when i type http://localhost/ReleaseTrackingSystem it works fine and navigates to: http://localhost/ReleaseTrackingSystem/Home.mvc
But when i click on the "About" Link the URL for some reason goes to: http://localhost/Home.mvc/About
as you can see the "ReleaseTrackingSystem" is missing from that URL which is causing it to break. any ideas?
Sorry for all the questions.
Regards
Vishal
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Hosting MVC Application on localhost
Jul 17, 2008 10:46 PM|LINK
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
vmb2000_uk
Member
15 Points
35 Posts
Re: Hosting MVC Application on localhost
Jul 18, 2008 11:58 AM|LINK
Hey Luis,
Ive found the reason to why its breaking. Just to let you know i am hard coding my URL's in my view because im not to sure if there are other ways.
For the "About" Link the code i use is: <a href="../Home.mvc/About"> About </a>
And the URL when i load my project is http://locahost/ReleaseTrackingSystem/Home.mvc (this is because my default.aspx has "Response.Redirect("~/Home.mvc")"
And when i click the about link it is going back one step (getting rid of the "ReleaseTrackingSystem" from the URL and adding Home.mvc/About which causes it to break)
So I have updated my Default.aspx to "Response.Redirect("~/Home.mvc/Index")"
and all works fine now. Thanks alot.
vmb2000_uk
Member
15 Points
35 Posts
Re: Hosting MVC Application on localhost
Jul 22, 2008 02:07 PM|LINK
Hi,
I managed to get my application working perfectly fine on my development machine. It runs perfect on localhost with no problems.
Unfortunately that isnt the end of al the problems.
I wanted to run my application on another machine. So let me explain the steps ive taken so far:
1) copied all the source files across to the new machine
2) installed .NET 3.5 Framework (had IIS installed already)
3) I then placed the source files in inetpub\wwwroot\
4) loaded IIS, and searched for the directory "ReleaseTrackingSystem" under default websites then went to the properties and created it as an application
5) checked that ASP.NET tab was set to 2.0
6) Followed a guide on the internet explaining how to get the default website to understand .mvc extentions
To do this i: went to the properties of the default website > Home Directory > Configuration > Added an extention with the same path as the .aspx but named it .mvc and unchecked "check that files exist"
7) SQL Server (my back end database) has been set up
8) i ran localhost/ReleaseTrackingSystem and it gives me the error:
The page cannot be found
Please try the following:
HTTP 404 - File not found
Internet Information Services
Technical Information (for support personnel)
Microsoft Support
Ive been trying so many things but i just cannot get rid of this message. The thing is when i navigate to http://localhost/ReleaseTrackingSystem it does recognise my default.aspx file and it changes the path to http://localhost/ReleaseTrackingSystem/Home.mvc/Index. But the page just doesnt load.
Any suggestions?
Many Thanks,
Vishal
dasBlog
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Hosting MVC Application on localhost
Jul 22, 2008 09:36 PM|LINK
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Hosting MVC Application on localhost
Jul 22, 2008 09:41 PM|LINK
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
vmb2000_uk
Member
15 Points
35 Posts
Re: Hosting MVC Application on localhost
Jul 23, 2008 08:55 AM|LINK
Im not 100% what you mean by the routing assemblies, all i did was copy the whole source code from my original laptop where i developed the application onto the target machine.
The code includes the bin folder and ive just checked and the bin folder has the following files:
ReleaseTrackingSystem.dll
ReleaseTrackingSystem.pdb
System.Web.Astractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
regards, vishal
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Hosting MVC Application on localhost
Jul 23, 2008 09:23 AM|LINK
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu