Giter Site home page Giter Site logo

Comments (8)

CZEMacLeod avatar CZEMacLeod commented on May 25, 2024 1

@mungk Have you had a chance to review this option?

from msbuild.sdk.systemweb.

mungk avatar mungk commented on May 25, 2024 1

Hi Cynthia, sorry I haven't been able to devote adequate time to this. Thanks for the advice and I'll keep working on it as my time allows. I'm going to go ahead and close the issue, though, since it does seem to be something on my end. Really appreciate everyone's help.

from msbuild.sdk.systemweb.

leusbj avatar leusbj commented on May 25, 2024

Thats an interesting question. I traditionally have the "Check out automatically" set as the behavior for both "Saving" and "Editing", so perhaps that has prevented me from experiencing this (or that the binding redirects are recalculated most frequently after changing NuGet Packages, which also triggers alterations to the web.config).

image

My expectation that attempting to perform a checkout via build scripts would be challenging, as it would likely need to tell the difference between TFVC and git style repos, and have a different behavior for each.

from msbuild.sdk.systemweb.

mungk avatar mungk commented on May 25, 2024

I have the same settings that you do and have for as long as I can remember. If it's working for you with those settings, perhaps there's something else throwing this wrench at me. Maybe the failure is not with MSBuild SDK but rather with something else that's preventing the automatic checkout from happening as it should. Thanks for the reply, I'll keep investigating.

from msbuild.sdk.systemweb.

leusbj avatar leusbj commented on May 25, 2024

@mungk I created a simple solution with a small project and a single dependency that will trigger a binding redirect (which is intentionally not currently in the web.config)

Checked into a TFVC style repo in AzureDevops, the solution containing my project and the web.config that is intentionally missing a binding redirect

The Local Build (Visual Studio -> Right Click -> Build) Succeeds for me

  • The message in build output indicating the BindingRedirects were applied is present
  • The "checked out" indicator on the web.config file in solution explorer
  • The newly added binding redirect is present in the web.config

The Azure Devops Build (Build Pipeline) Succeeds for me

  • The message in build output indicating the BindingRedirects were applied is present in the pipeline run logs
  • The newly added binding redirect is present in the web.config contained in the published artifacts

I think there might be something specific about your workspace or workstation.

from msbuild.sdk.systemweb.

mungk avatar mungk commented on May 25, 2024

@leusbj Thanks for taking the time to recreate this. Unfortunately, I still have the problem but can't really figure out why. I have the same settings as you:

image

Under Team | Team Project Settings | Source Control... multiple check-outs are enabled:

image

And under Team Project Collection Settings, we are using Server workspaces rather than local.

image

In your recreation, did you happen to use Local or Server workspaces?

from msbuild.sdk.systemweb.

CZEMacLeod avatar CZEMacLeod commented on May 25, 2024

@mungk I haven't tested this personally, but you might be able to get the correct operation, even with readonly forced for checked in files, which is the default on Server workspaces.

  <Target Name="SystemWebProject_TFVC_CheckOutForBindingRedirects"
          DependsOnTargets="SystemWebProject_ChooseConfigFileForGenerateBindingRedirects"
          BeforeTargets="GenerateBindingRedirects" 
          Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and @(SuggestedBindingRedirects-&gt;Count()) &gt; 0 ">
    <PropertyGroup>
      <TF>$(VSAPPIDDIR)CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe</TF>
    </PropertyGroup>
    <!-- Automticly checkout files -->
    <Exec Condition="( '$(GeneratedBindingRedirectsAction)' == 'Preview' or '$(GeneratedBindingRedirectsAction)' == 'Overwrite' ) and EXISTS('$(_GenerateBindingRedirectsIntermediateAppConfig)')" 
          Command="&quot;$(TF)&quot; checkout /noprompt &quot;$(_GenerateBindingRedirectsIntermediateAppConfig)&quot;">
    </Exec>
  </Target>

Make sure you are using the SDK version 4.0.81 or higher.

You might need other conditions added, as this doesn't actually check that TFVC is in use, and it might not be appropriate or work correctly on a build server etc.

I doubt this is something we would add directly to the SDK, although if it works for you, maybe it could be something we add to the documentation for those still using TFVC.

from msbuild.sdk.systemweb.

CZEMacLeod avatar CZEMacLeod commented on May 25, 2024

@mungk 🏓 Ping?

from msbuild.sdk.systemweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.