Error CA1701 from XML String that can't be read as a value

AN77

New member
Joined
Jul 11, 2023
Messages
3
Programming Experience
5-10
Hi All

I have a really odd issue. I've done an Add-Migration in EF CORE, and it's added a new migration script into my project. However my issue is that the project can't compile anymore because of the XML file that was added from the Add-Migration command.
The code below is what's giving my project issues.

1689133421170.png


This is the error that VS has provided.
1689133460560.png


I believe it's because it's not reading the <value></value> content appropriately since the colors of the tags aren't the same. So I decided to help it out by adding line breaks into the code so that it could hopefully parse the information and read that it's value data rather than one big string.

1689133607654.png


But this didn't work either, and VS still refused to acknowledge that the contents between the <value> tags aren't code.

Any help would be appreciated.
Thanks!
 
Last edited:
Moving to Entity Framework...
 
What version of Visual Studio are you using?

CA1701 is a deprecated rule. You should suppress or ignore the rule.

Why are you running FxCop against your XML file?

Hey thanks for the reply. I'm using VS2022 and I'm working on an old project at work that's been around for about 20 years. If I were to suppress the rule this would allow me to build it and hopefully allow it to build on the CI server.
 
Depends on your team culture. Are you allowed to suppress FxCop rules?
 

Latest posts

Back
Top Bottom