2017-08-21 3 views
0

Je suis en train de publier mon application Azure par Visual Studio, mais je continue à obtenir l'erreur suivante:Où puis-je obtenir la « IgnoreDatabaseOutOfSync » propriété

Severity Code Description Project File Line Error Publish Database Setting Source Verification Error: The connection 'DBConnection' in the publish profile has changed from what is currently declared for 'DBConnection (path_to_my_web.config)'. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit http://go.microsoft.com/fwlink/?LinkId=241526 PhotographyAPI 0

Où puis-je désactiver cette vérification en spécifiant la valeur de "True" pour la propriété MSBuild "IgnoreDatabaseSettingOutOfSync" ??

Où puis-je définir cette propriété?

Répondre

1

Vous devez modifier manuellement votre fichier .csproj pour définir des propriétés MSBuild individuelles pour lesquelles Visual Studio n'a pas d'interface utilisateur. Habituellement quelque part près du haut du fichier, il devrait y avoir un élément <PropertyGroup> sans attribut Condition. Ce groupe spécifie les propriétés qui s'appliqueront à toutes les configurations (comme Debug, Release, etc.). Vous pouvez ensuite ajouter la propriété à ce groupe:

<PropertyGroup> 
    <IgnoreDatabaseSettingOutOfSync>True</IgnoreDatabaseSettingOutOfSync> 
</PropertyGroup> 

(bien sûr, vous pouvez ajouter un PropertyGroup supplémentaire, juste être sûr de le faire avant que les <Import> éléments qui font référence à .targets fichiers.). Notez que cela supprimera l'erreur, mais les paramètres de base de données modifiés peuvent encore être dangereux pendant le déploiement. (c'est pourquoi l'erreur existe en premier lieu)