Archive
Fix: “The Global element ‘xx’ has already been declared” warnings in config files after .NET framework upgrade in Visual Studio solution
Had just converted to target .NET framework 4.7.2 a Visual Studio solution full of 4.5 libraries, console apps and an MVC 5.0 (recently converted from 4.0) web app and all seemed to build fine, but then noticed that with web.config of the MVC web app open in the editor, it was showing lots of warnings of the form:
The Global element ‘xx‘ has already been declared in …
and marking them in the text with blue underscores under some whitespace
Seems others have had this issue too with configuration files (both ASP.net and Entity Framework ones) after changing target .NET framework:
Luckily the solution was hidden in that thread, just had to pick the best one (read on below)
– at https://stackoverflow.com/a/52274659/903783 one reads (see related screenshot there):
I noticed this issue with my VS2017.
Changing DotNetConfig.xsd to use "Automatic" solved the problem.
This doesn’t seem to work permanently (only worked once for a while for me)
– at https://stackoverflow.com/a/28114738/903783 is says:
With the symptoms as described in the question, and using Visual Studio 2013 (Update 4), I could see in the XML Schemas [sic] dialog that both
DotNetConfig.xsd
andDotNetConfig40.xsd
were selected for use.I’m using a .NET Framework 4.0 project.
The two XSD files conflict with each other, each defining the same elements, causing the warnings to be emitted.
These schema files are contained in the
%programfiles(x86)%\Microsoft Visual Studio 12.0\xml\Schemas\
folder.
DotNetConfig.xsd
is in the1033
sub-folder and appears to be the newer, more complete version.No matter what settings I selected in XML Schemas, I could not deselect, or remove DotNetConfig40 nor DotNetConfig. I tried "Remove", and changing the Use parameter from "Use this schema" to "Automatic" and then "Do not use this schema".
No matter what was selected, for either file, when I would return to the dialog, both would be selected for use. I also tried the trick of moving to another row before pressing "OK" to no avail.
Finally, I renamed the
DotNetConfig40.xsd
file toDotNetConfig40 DO NOT USE.xsd
to prevent it from being loaded. This immediately solved the problem.
This does work (adapting the path for VS2017), but one isn’t sure (unless they check the file dates maybe) which file to keep, in my case it was 1033/DotNetConfig.xsd and DotNetConfig45.xsd, nor are they sure this won’t cause any side-effects in other solutions/projects.
– Finally, at https://stackoverflow.com/a/33823331/903783 it read:
I struggled with this for a while as well. Turns out, my version of the problem originated from the hidden
{PROJECTNAME}.SUO
file created by Visual Studio.My guess is, VS will cache the XSD schema associations in this file. The warnings popped up after I changed the target framework, and they disappeared after I deleted the SUO file and restarted VS.
This fixed it permanently. Deletion of the .suo ended up with the DotNetConfig.xsd and removed the DotNetConfig45.xsd from the XML schemas list for the projects in the solution. In fact I deleted just a .suo file with no filename part, just a file extension, found by typing “.suo” at the search filter in the top-right of the solution’s folder window in Windows 10 File Explorer.
Fix: Reset forgotten Windows Phone pin remotely if locked out of it
I got an older Lumia 930 phone (nice big display and 20MP camera, Windows Mobile 8.1 upgradeable to Windows 10, main shortcoming is that it doesn’t have microSD slot) on big discount the other day, but after upgrading it to Windows 10 I accidentally entered the wrong PIN code at login an it managed to lock permanently.
I was having the deadlocking situation where after it locked asking me to reboot, at each reboot (even tried resetting with power+vol down for 10sec), it was saying the same thing again and again.
Luckily I had already activated a Microsoft account (was required at Win8.1 in order to download the Windows upgrade advisor app from the store), so following the guidance at https://answers.microsoft.com/en-us/mobiledevices/forum/mdlumia-mdsettings/how-to-reset-phone-if-i-forgot-my-lockscreen/ff4d7ba3-d301-4392-b05a-46bac68dcc69 and some other forum discussions, I went to http://account.microsoft.com, then at the Devices section, selected to see more info on that specific phone and then from Find My Phone I choose to lock it with a new 6-digit pin.
There, it asks you to also enter a message that is supposed to display to the user of the phone, but haven’t seen it appear. However it does make it to change it successfully.
For changing the pin remotely the phone obviously needs to have wifi or data access active (if it doesn’t and doesn’t allow you to set it without entering a code, try plugging it via USB to a Windows 10 computer first or if you’ve set it up to connect automatically to open hotspots find one such). Else will need to have a SIM and number and be connected (correct SIM pin entered) to mobile (GSM etc.) network. The lock phone pane at account.microsoft.com does ask you if the phone has a number assigned to it or not, to send some special locking SMS I guess.