Answered by:
Change in Web reference from app.config file in Project

Question
-
User1327719509 posted
HI,
My excuse of the subject line if wrong.
I need you peoples expert advice on one of my project.
Scenario:
I have ASP.NET 2.0 project which is n-Tier project. In one or many tier (project in same solution as my website) I am using web services and these project are added as references. So the dll comes in my BIN folder of website.
I have two different web application and web services related to each one of them i.e. one for my testing and another for my live. So when I want deploy my website on testing, I compile my code and deploy on testing web app and if testing is success then I copy my compiled code from testing to live web app.
Problem:
Now the problem when I change any thing in my project (i.e tier), I need to change web references for that project from development environment, compile it and deploy on testing. If testing is ok then I have to again change the web references for the web service, compile it again and deploy on live.
Needed Solution:
So my question is; is there any other way to just change in config file and without compile again for live I can move from testing to live.
Note: Though I am using ASP.NET 2.0 version my code gets compiled in backward compatibility i.e. 1.1.Example:
I will give you example of scenario.
I have one solution file say SampleSolution in that I have one Business Layer say BLayer as project in solution and one website say SampleWebsite in same solution.
Now my web service is in Blayer Project. When I add web reference (i.e. web service) of testing environment in this project it creates reference in app.config file. Now when I add reference of this project in my website (i.e. SampleWebsite), DLL of this project (i.e. BLayer.ddl & BLayer.pdb) is add in my BIN folder. While deploying on testing server I will compile the website and publish it and copy these files (i.e. BLayer.ddl & BLayer.pdb) along with other files in website to my testing server. After clearing testing and moving to live server I have change the path of my web reference to live server and compile it (i.e. BLayer) again to deploy on live server again. This is what I don't want to do.
Is there any way to do it without compiling BLayer again.Regards,
Fahad.
Friday, July 1, 2011 5:23 AM
Answers
-
User1368300014 posted
if ur virtual directory is get different.
u can handle the issue by getting the virtual directory name an picking the right reference from config file.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, July 1, 2011 7:54 AM
All replies
-
User1368300014 posted
if ur virtual directory is get different.
u can handle the issue by getting the virtual directory name an picking the right reference from config file.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, July 1, 2011 7:54 AM -
User1327719509 posted
My Config file is in Project and when I add reference in my website only DLL files comes from project not dll.config file.
Saturday, July 2, 2011 3:07 AM -
User1368300014 posted
as per now it should be a manuall process while deployin it to the live server
Monday, July 4, 2011 1:06 AM