Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 01, 2011 09:40 AM by Sathesh_Pandian
Contributor
2706 Points
481 Posts
Jun 23, 2011 07:25 AM|LINK
hi,
i am facing some problems when i am trying to deploy the MVC3 application in IIS. This application is developed on database first approach.
Its working fine in IIS express and also working fine with visual web developer express.
its throwing error when i have tried to deploy it on production server.
The configurations are same. IIS 7.5, sql server 2008.
i have added the _bin_deployableAssemblies so that it would not miss any dlls.
Everything fine except when its calling the dbcontext.
Please give me some solution for this.
mvc3
3712 Points
838 Posts
Jun 23, 2011 07:29 AM|LINK
Could you perhaps give us the errormessage? Otherwise its impossible to locate the problem
Jun 23, 2011 08:37 AM|LINK
Jun 23, 2011 08:46 AM|LINK
You need to set the username and password in the connectionstring or allow that user to connect to the sql server.
When you run it in IIS Express it is executed as yourself, but when you deploy it runs as the user set on the applicationpool
Jun 23, 2011 08:48 AM|LINK
can you provide me the sample connectionstring?
Jun 23, 2011 08:52 AM|LINK
If you just remove "Integrated Security=true" and add "User ID=xxx;Password=xxx" instead it should work
That is the userid and password of the sql server user.
Jun 23, 2011 08:57 AM|LINK
hi knecke,
i used it already and still its throwing the same error.
Jun 23, 2011 09:09 AM|LINK
It says "Login failed".
Either there is wrong username/pass combination. OR the user don't have access to the SQL Server. It is as easy as that.
But since the errormessage say that it is using the applicationpool user i suspect you dont have userId/password in the connectionstring
Jun 23, 2011 11:34 AM|LINK
its not related to either sql server or asp.net.
This is issue happened only in MVC3
Jun 23, 2011 12:07 PM|LINK
I think you are wrong, the login still fail according to the errormessage. How does your connectionstring look like?
Sathesh_Pand...
Contributor
2706 Points
481 Posts
Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 07:25 AM|LINK
hi,
i am facing some problems when i am trying to deploy the MVC3 application in IIS. This application is developed on database first approach.
Its working fine in IIS express and also working fine with visual web developer express.
its throwing error when i have tried to deploy it on production server.
The configurations are same. IIS 7.5, sql server 2008.
i have added the _bin_deployableAssemblies so that it would not miss any dlls.
Everything fine except when its calling the dbcontext.
Please give me some solution for this.
mvc3
Knecke
Contributor
3712 Points
838 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 07:29 AM|LINK
Could you perhaps give us the errormessage? Otherwise its impossible to locate the problem
mvc3
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
Sathesh_Pand...
Contributor
2706 Points
481 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 08:37 AM|LINK
Cannot open database "MyNamespace.Models.SampleContext" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
mvc3
Knecke
Contributor
3712 Points
838 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 08:46 AM|LINK
You need to set the username and password in the connectionstring or allow that user to connect to the sql server.
When you run it in IIS Express it is executed as yourself, but when you deploy it runs as the user set on the applicationpool
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
Sathesh_Pand...
Contributor
2706 Points
481 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 08:48 AM|LINK
hi,
can you provide me the sample connectionstring?
Knecke
Contributor
3712 Points
838 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 08:52 AM|LINK
If you just remove "Integrated Security=true" and add "User ID=xxx;Password=xxx" instead it should work
That is the userid and password of the sql server user.
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
Sathesh_Pand...
Contributor
2706 Points
481 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 08:57 AM|LINK
hi knecke,
i used it already and still its throwing the same error.
Knecke
Contributor
3712 Points
838 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 09:09 AM|LINK
It says "Login failed".
Either there is wrong username/pass combination. OR the user don't have access to the SQL Server. It is as easy as that.
But since the errormessage say that it is using the applicationpool user i suspect you dont have userId/password in the connectionstring
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
Sathesh_Pand...
Contributor
2706 Points
481 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 11:34 AM|LINK
its not related to either sql server or asp.net.
This is issue happened only in MVC3
Knecke
Contributor
3712 Points
838 Posts
Re: Best method to deploy the database first approach based application in MVC3
Jun 23, 2011 12:07 PM|LINK
I think you are wrong, the login still fail according to the errormessage. How does your connectionstring look like?
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter