Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade via NuGet should add bindingRedirect #98

Closed
pbolduc opened this issue Nov 4, 2015 · 5 comments
Closed

upgrade via NuGet should add bindingRedirect #98

pbolduc opened this issue Nov 4, 2015 · 5 comments

Comments

@pbolduc
Copy link

pbolduc commented Nov 4, 2015

When upgrading using NuGet packages, the package should add bindingRedirect to app.config/web.config to prevent assembly load failures.

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.2.0.5639" newVersion="1.2.0.5639" />
  </dependentAssembly>
@SergeyKanzhelev
Copy link
Contributor

NuGet will do it automatically when you have a reference to the other project that in turn using older version of Microsoft.ApplicationInsight assembly. Do you have specific example when it fails to do it?

@pbolduc
Copy link
Author

pbolduc commented Nov 4, 2015

I upgraded one of my web projects yesterday. When I deployed it got a could not load Application.Insights assembly. I was on version 1.x and upgraded to the latest 1.2. The web.config file did not get updated. Let me see if I can find the time later today to go back to the previous version and reproduce the steps.

@SergeyKanzhelev
Copy link
Contributor

Make sure you don't have "hidden" references to the older version of SDK. Here is an article explaining how bindingRedirect works

@pbolduc
Copy link
Author

pbolduc commented Nov 4, 2015

I believe the original packages were added using Visual Studio "Add Application Insights" right context menu item. However, since adding is a function of NuGet, not the package itself, I will close this issue.

@pbolduc pbolduc closed this as completed Nov 4, 2015
@SergeyKanzhelev
Copy link
Contributor

Thanks @pbolduc. You should definitely let us know even if it is NuGet error.

BTW, "Add Application Insights" would just invoke NuGet installation, register new component and put instrumentation key into ApplicationInsights.config. So from bindingRedirect perspective it is working exactly the same way as if you just call Install-Package Microsoft.ApplicationInsights.Web from package manager console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants