Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2016, 10:00 AM
Registered User
 
Join Date: Feb 2016
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default Chapter 19: Question About Web.Config Transforms

I have a quick question about web.config transforms as discussed in Chapter 19.

I followed the guidelines in the chapter for my own site (not the Planet Wrox site) and make a publishing profile and a web.config transformation file to modify my connection strings and some other things. It all worked wonderfully, and when I looked in the web.config emitted from the publishing process, the file the changes were all there.

However, I noticed the transformation .config file was emitted into the list of published files as well, and this confused me. In my naive understanding of this process, I was sort of thinking of that file as being something that Visual Studio would use to modify the real web.config file for my published site, but that that file itself wouldn't actually be needed on the production machine.

Obviously it's not a big deal for me to put it on the server too, but it made me worry I didn't fully understand how this transform file worked, and that I had missed something important.

Thanks in advance for any responses.
Erik
 
Old February 19th, 2016, 05:32 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Erik,

For Web Site Projects, I don't think there's an easy way to do this. For Web Application Projects you can simply set the build type of a file on its Properties Grid to be excluded, but you have no such option for Web Site Projects.

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!
The Following User Says Thank You to Imar For This Useful Post:
ErikWW (February 21st, 2016)
 
Old February 19th, 2016, 05:39 PM
Registered User
 
Join Date: Feb 2016
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thanks.

I was worried that somehow because it was included in the publishing step that it was needed for some reason I didn't quite understand. Sounds like that's simply not true and it's just that VS wasn't smart enough to automatically leave it out of the published files.

Thanks for the reply. And thanks for the great book. I'm learning a lot.
 
Old February 19th, 2016, 05:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> and it's just that VS wasn't smart enough to automatically leave it out of the published files.

Yep. Remember that a Web Site Project is "just" a folder, so VS has no way to keep track of which file is relevant / content, and which one is not. With a Web Application Project this is a lot easier.

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!
The Following User Says Thank You to Imar For This Useful Post:
ErikWW (February 21st, 2016)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19: Moving Application Settings to Web.config phztfte1 BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 10 January 31st, 2016 03:46 PM
Chapter 19 - Web Services Drogil BOOK: Beginning Visual C# 2010 1 June 10th, 2013 03:39 PM
Web.Config Question Pdesignz BOOK: Beginning ASP.NET 4 : in C# and VB 2 July 16th, 2012 05:20 AM
Chapter 19 Web Services sef BOOK: Beginning Visual C# 2010 3 February 14th, 2012 09:11 AM
Web.Config Question RPG SEARCH ASP.NET 1.0 and 1.1 Basics 4 February 3rd, 2005 09:31 AM





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