.config files do not transform in VS 2012 RC #16

Closed
jhubsharp opened this Issue Jun 8, 2012 · 29 comments

Projects

None yet

7 participants

@jhubsharp

After switching to VS 2012 RC, it doesn't look like SlowCheetah is transforming files when i publish to my development server. Files are still transforming in 2010 and were fine in 2011 Beta.

@sayedihashimi
Owner

What type of project do you have?

@jhubsharp

MVC3 web application project

@sayedihashimi
Owner

For web projects the transforms are kicked in during package/publish. In desktop apps (i.e. WPF app) the app.config is placed into a different folder so there is no harm in transforming it during build.

@jhubsharp

I'm confused as to how that closes the issue. I have a project containing a web application and a class library with linked config files. If I publish the web app in 2012 RC and go check the dev server nothing gets transformed, either at root or in bin. If i open the same solution in 2010 and publish to the same server, the files get the transforms applied. This seems like a bug to me.

@butchera

Im having the same problem jhubsharp did you ever get a solution to your problem? Not sure why this has been closed.

@jhubsharp

I haven't heard anything back. I've just stopped trying to do deployments in 2012 RC since the transforms don't work. I don't know why the issue was closed either, but I've shrugged my shoulders and moved on.

@sayedihashimi sayedihashimi reopened this Jun 26, 2012
@sayedihashimi
Owner

Sorry I've misunderstood the bug here. I've reopened it. I am currently out of the country but when I get back I will look into this. Sorry about that.

@sayedihashimi
Owner

This should be resolved by commit c6e4a4c.
I have an updated download available at https://dl.dropbox.com/u/40134810/SlowCheetah-c6e4a4c.zip I'd appreciate it if you could verify the fix. For now I will close this item but please re-open if it you are still seeing an issue after installing that update.

I will update the public release probably in a week or so. I have a few more bugs which need to be fixed.

if you'd like to try it out.

@jhubsharp

Thanks Sayed. I'll verify next week and let you know.

@leniel
leniel commented Aug 16, 2012

Sorry for commenting on this issue...

I got confused about the versioning. When I wrote this I had Slow Cheetah 2.3 that I got yesterday through VS Extensions and Updates in the Tools menu option. As you can see here http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5 there's a new version 2.4 released yesterday. I installed v. 2.4 and now it works as expected! AWESOME.


Sayed,

This is a great addition to Visual Studio, but I'm having this same problem right now. As I mentioned yesterday https://twitter.com/johnleniel/status/235781349745762304, I added a transform for a log4net.config file. I'm working with an ASP.NET MVC 4 app and I have the latest bits of Slow Cheetah v 2.3 from yesterday. All this being done with Visual Studio 2012 RC and Windows 8 RC.

So I had this:

log4net.config

When I added the transform I got these additional files:

log4net.Debug PdfGenerator.config
log4net.Debug.config
log4net.Release.config
log4net.Vortex.config

I added a transform to change a connection string inside log4net.Vortex.config. In the Preview Transform window I can see that it changes the connection string correctly but when I deploy using Vortex build configuration I get all transform files deployed. log4net.config remains intact, that is, no transform is applied.

See the screenshot:

Image Alt

@onionhammer

Yeah, this still isn't working for me in the RTM.

Using the VS2012 RTM, I clicked 'Publish' and the .config file (inside app_data folder) is no longer transformed (as it used to be in VS2010). If I click the 'preview transform' button, it shows a working transformation, however. It just doesn't work from a publish.

@sayedihashimi
Owner

Are you publishing using file system? I just noticed that its broken. But both publish/package look to work. I'm looking into this now.

@onionhammer

Yes I am publishing to filesystem

thanks!

@sayedihashimi
Owner

I have a fix ready at https://dl.dropbox.com/u/40134810/SlowCheetah/SlowCheetah-v2.4.1.zip. Can you uninstall the old version and then install this one and let me know if it works?
Can you also confirm that when you go to Tools->Extensions->SlowCheetah that it states the version is 2.4.1?

@onionhammer

👍

works like a charm! good work

@dotnetnico

Hi,

I have a similar problem when publishing a WCF project to file system.

When I preview the transforms they are all fine. However when I publish, the base app.config is transformed to web.config. Building makes no difference.

I've tried your hotfix, same problem.

I run VS2010 SP1 Ultimate on Windows 7 Professional.

Any clue?

Thanks!

Nico

@sayedihashimi
Owner

@dotnetnico sorry for the late reply here. Could you provide a sample project that I could take a look at?

@dotnetnico

@sayedihashimi. Just created a sample project to retest. Same problem occurs. The preview is ok, the build is not.

I've uploaded the project here: http://dl.dropbox.com/u/25414674/WcfSlowCheetahSample.rar

In this rar you'll find a sample solution and a build dir. Tested with "publish to file system" to this build dir. As you can see the transform is not applied to web.config.

Any idea what's going on here?

Thanks in advance!

Nico

@sayedihashimi
Owner

I looked into this and I'm not sure if this can be done for this project type. The issue here is that this is not a vanilla web project and when you publish from VS there may not be (I'm not 100% sure) the extensibility for me to hook into this. I think the normal web projects suffer from this same issue for the file system publish method. The MSDeploy and the package methods have the required extensibility hooks to do this.

I'm not going to close this just yet because I want to take a deeper look into this.

Do you know how to publish these projects from the command line? If so then the transforms should kick in for those cases. If the do not let me know the steps to publish from the command line and I'll investigate it.

@dotnetnico

Thanks Sayed! Would be great if you're willing to take a closer look at this!

I have no problems with my web projects in MVC3. MVC4 not yet tested.

Slow Cheetah does pick up the transforms in the WCF project when building from the commandline using MsBuild.

@leniel
leniel commented May 23, 2014

This issue is happening again on my side... for my surprise I even commented here on this issue in 2012. :D

Even deploying to a disk Web Deploy Package the transform is not applied to that same log4net file I mentioned in my previous comment.

Looking at the Transform Preview it's doing the transform just fine.

Right now I have <package id="SlowCheetah" version="2.5.10.6" targetFramework="net45" /> installed in an ASP.NET MVC 5 app. Using Visual Studio 2013 Update 2 on Windows 8.1.

@sayedihashimi
Owner

If you are publishing in VS using FileSystem the transforms won't be executed :( Its a VS limitation. When publishing from msbuild they do execute.

@leniel
leniel commented May 23, 2014

@sayedihashimi I also tried publishing to the production server using Web Deploy with

<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>

It did not transform the log4net.config file.

Let me know if you need any more info to debug this further.

@sayedihashimi
Owner

I actually can't repro it now. Can you share a sample and repro steps?

@leniel
leniel commented Jun 7, 2014

Sayed... sorry for the delayed response. Just now I got back to this project.

Good news: you can disconsider my previous comment! :) It's working as expected.

The problem was that I created a new solution Configuration in Configuration Manager named Vortex BUT was actually using the Release configuration for each solution project for the Active solution configuration [Vortex]. Then during the packaging it was obviously not picking up the log4net.Vortex.config.

visualstudioconfigurationmanageractivesolutionconfigurationvsconfiguraitonsetforeachproject

@sayedihashimi
Owner

Ok 👌 thanks for the update

@msgigabyte

Hi, I am using visual studio Msdeploy option to publish site. Still log4net transformation is not working. Any idea what Else i need to do.

@msgigabyte

IN previous comment by leniel it says
@sayedihashimi I also tried publishing to the production server using Web Deploy with
WMSVC
Can you please guide where should I use this setting in .proj?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment