Build error for Azure Worker role if a non-app.config file is being transformed #44

Closed
otakusid opened this Issue Nov 9, 2012 · 18 comments

Projects

None yet

2 participants

@otakusid
otakusid commented Nov 9, 2012

Hi!

I have a issue with custom configs, that added to the 'Azure Worker Role' project. I tryed to move connection strings declaration in the separate file and apply transformations to this file.

When I build or rebuild solution - all works fine. But when I run - I am getting following error:

Error   1   The item "bin\Debug\connectionStrings.config" in item list "OutputGroups" does not define a value for metadata "TargetPath".  In order to use this metadata, either qualify it by specifying %(OutputGroups.TargetPath), or ensure that all items in this list define a value for this metadata.    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets  1663    5   SlowCheetahAzure

I use the .NET Framework 4.5, Windows Azure SDK for .NET 1.8 and MSVS 2012.

Also I make the test solution that you could use to reproduce this issue:

https://dl.dropbox.com/u/24442837/Builds/SlowCheetahAzure.zip

P.S.: One more man experienced this issue when try to use custom 'NLog' config with 'Azure' project:

http://stackoverflow.com/questions/11790895/azure-worker-role-configuration-issue-while-using-slowcheetah-with-custom-config

@otakusid

It seems that some issues will never be read...

@sayedihashimi
Owner

Sorry its not that I'm trying to ignore you, but I'm having a difficult time keeping up with the requests on this project.

Can you provide steps that I can follow to reproduce this from a new project?

@otakusid

Hi Sayed,

Sorry, but when issue has no comments for long period of time it looks abandoned.

Here is scenario that you can use to reproduce this issue from a new project:

  1. Ensure that you have the Windows Azure SDK 1.8
  2. Create the 'Windows Azure Cloud Service' project.
  3. Add one 'Worker Role' to the cloud service.
  4. Add the 'connectionStrings.config' file to the 'Worker Role' project. Fill this file with some test data, for example:
    <connectionStrings>
        <add name             = "MyConnString"
             connectionString = "SomeConnStringData"
             providerName     = "System.Data.SqlClient" />
    </connectionStrings>
  1. Add transformations for the 'connectionStrings.config' file.
  2. Try to start the cloud project (F5).

What we have:

The error that is not allow to start the cloud service project.

Error   1   The item "bin\Debug\connectionStrings.config" in item list "OutputGroups" does not define a value for metadata "TargetPath".  In order to use this metadata, either qualify it by specifying %(OutputGroups.TargetPath), or ensure that all items in this list define a value for this metadata.    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets

What we need:

MSVS should run the cloud service project.
@sayedihashimi
Owner

Thanks for the info I will take a look at it but I cannot comment as to when.

@sayedihashimi
Owner

Thanks for the details here. I have updated the title of this issue, I am investigating. Should be included in the next release.

@sayedihashimi sayedihashimi added a commit that referenced this issue Jan 4, 2013
@sayedihashimi Updating AfterBuiltProjectOutputGroup to populate BuiltProjectOutputG…
…roupOutput using the full path to the file instead of the relative path. Related to issue #44
c5860cb
@sayedihashimi
Owner

Hi @otakusid I think I have figured this out.

I have a fix available at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44.zip. Could you try it out and let me know if you are still running into this?

@otakusid
otakusid commented Jan 4, 2013

Hi!
I verified this fix. When I run solution no more error appeared. So looks like issue fixed!

@otakusid
otakusid commented Jan 8, 2013

Hi Sayed,

I verified this fix on my second project and found that this issue is not fixed for referenced configs :(

How to reproduce:

  1. Ensure that you have the Windows Azure SDK 1.8
  2. Create the 'Windows Azure Cloud Service' project.
  3. Add one 'Worker Role' to the cloud service.
  4. Add the test 'connectionStrings.config' file and transformations for this file to the solution:
    solution
  5. Create a reference for this file in the 'Worker Role' project file:
    <Content Include="..\Configuration\connectionStrings.config">
      <Link>connectionStrings.config</Link>
      <TransformOnBuild>true</TransformOnBuild>
    </Content>
    <None Include="..\Configuration\connectionStrings.Debug.config">
      <Link>connectionStrings.Debug.config</Link>
      <DependentUpon>connectionStrings.config</DependentUpon>
      <IsTransformFile>True</IsTransformFile>
    </None>
    <None Include="..\Configuration\connectionStrings.Release.config">
      <Link>connectionStrings.Release.config</Link>
      <DependentUpon>connectionStrings.config</DependentUpon>
      <IsTransformFile>True</IsTransformFile>
    </None>
  1. Try to start the cloud project (F5).

What we have:

The error that is not allow to start the cloud service project.

Error   1   The item "bin\Debug\connectionStrings.config" in item list "OutputGroups" does not define a value for metadata "TargetPath".  In order to use this metadata, either qualify it by specifying %(OutputGroups.TargetPath), or ensure that all items in this list define a value for this metadata.    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets

What we need:

MSVS should run the cloud service project.
@sayedihashimi
Owner

This looks to be related to the fact that the files are linked. If the transforms are directly contained inside the project I do not receive an error. I'm looking into this to see what is happening here.

@sayedihashimi
Owner

I think I have fixed this. I have a new candidate VSIX at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44-v2.zip.

Could you try it out and let me know if it resolves the issue for you?

@otakusid

Hi Sayed!

I confirm that in the latest version issue fixed as for usual configs so and linked ones. Thank you!

@otakusid

Also I found one more issue related to linked non-app.config files #63. Could you please look at it?

@sayedihashimi
Owner

Thanks @otakusid I just made some changes in commit 2ca26f0 for this.

I have updated the VSIX at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44-v2.zip can you try again?

@otakusid

Work like a charm! Transformed linked non-app.configs placed in the approot.

@sayedihashimi
Owner

I have released this feature on the VS gallery at http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5 as well as in the NuGet package https://nuget.org/packages/PackageWeb.

If you have any issues let me know.

@otakusid

Thank you, tomorrow I will check this release version on our test environment.

@otakusid
otakusid commented Feb 4, 2013

Hi Sayed, I verified new version on our test environment - all works fine. Also you could close #63 - it is fixed.

@sayedihashimi
Owner

Thanks, I've closed it.

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