Why my web.config is scrambled in VS 2013 - visual-studio-2013

This morning, all the sudden my project complains lots of thing, I then found out because the whole web.config is scrambled to something I don't know.
Fortunately I had a backup, after restoring Rebuild got this:
Error 3 Application Configuration file "Web.config" is invalid. '.', hexadecimal value 0x00, is an invalid character. Line 2, position 1.
Here is the first 2 lines of it:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
1> What is web.config scrambled unintentionally?
2> IE can display this restored web.config, why VS is complaining?
More info about my machine:
- Win 7 64-bit, running perfect w/ VS 2008/13 installed for a while.
- VS 2013 Community.

The file may become corrupted and encoding was changed during saving.
Open the web.config file with Notepad++ (or any text editor) and make sure the encoding is set to UTF8.
if not, save it and check if it solved your issue.
Hope it support your issue.

Related

VS Code debugger: failure to find module (utf-8 characters)

When I try to run a Node.js debugging session from Visual Code, the debugging console returns an error, saying that the bootloader.bundle.js could not be found. However, the bootloader.bundle.js file exists at the expected location, while the debug console specifies the folder incorrectly by substituting a UTF-8 character (letter č) with the replacement character (�). The snippet of the error message can be found below:
Error: Cannot find module 'c:/Users/xxxx xxxx�/AppData/Local/Programs/
Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js'
Can I somehow fix this in VS Code, perhaps by modifying the launch.json file in some way or some other settings?
Any help is appreciated!
EDIT:
I temporarily fixed the issue by reinstalling VS Code to another folder without that doesn't include diacritical characters. I'd like to to keep this question open, however, in case somebody knows of a way to fix this sort of problem (e.g. by by modifying some configuration files) that does not require either reinstalling or relying on a portable version of the app.
I have just dealt with the same issue. There have been Unicode characters in my folder's path and I got the same error "Cannot find module". Reasons are described in details here.
To fix it I have gone to File - Preferences - Settings and then entered "usePreview" and then I unchecked the option "Use the new in-preview JavaScript debugger for ..." under the section "Debug > JavaScript: Use Preview" and reloaded VS Code. The issue has gone.

"Error in parsing the app package." when opening Windows 10 .appinstaller file from web (MSIX)

So I'm trying to use the direct app install feature of Windows 10 Creators Update to allow downloading a packaged modern app from the web. The key feature of it is that it will auto update your app by checking back to the same URL of the .appinstaller file.
https://new-file-explorer.firebaseapp.com/ (the page is entirely generated by Visual Studio, no modifications from me)
The problem is that when I click it I just get "Error in parsing the app package."
If I manually download the .msixbundle that's referenced in the .appinstaller file it will work! Yet App Installer itself can't "parse" this package?
Here's the weirdest part: if I use "Add-AppxPackage -Appinstaller" from Powershell and point it towards the .appinstaller URL it will completely work!
The other answers on here do not apply, since they were all related to running it on a local server (I tried it anyways).
I thought this was related to MIME types, but I have set the MIME types as stated in the documentation and yet it still doesn't work. I've verified that by using this URL MIME type checker. I'm at a loss to what is actually causing this.
Here is the .appinstaller file:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller Uri="https://new-file-explorer.firebaseapp.com/InstallNFE.appinstaller" Version="1.0.9.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">
<MainBundle Name="NewFileExplorer" Version="1.0.9.0" Publisher="CN=david" Uri="https://new-file-explorer.firebaseapp.com/InstallNFE_1.0.9.0_Test/InstallNFE_1.0.9.0_x86_x64.msixbundle" />
<UpdateSettings>
<OnLaunch HoursBetweenUpdateChecks="0" />
</UpdateSettings>
</AppInstaller>
Here's a link to the .msixbundle it appears to be incapable of parsing (as you can see, it works manually downloading it!)
Thought of putting the solution in case someone else is facing the issue. I also faced the same issue and was able to resolve myself. When opening the Windows 10 .appinstaller file from web, the error "Error in parsing the app package." occurs.
For me the cause was that the links provided in the HTML page index.html generated by Visual Studio was referring to some share location (as my installer location was a file share location) and the installer file was not there. The reason for this is that I didn't do the last step "Copy and Close" of publishing from VS (this step copies the installer from output location to installer location that you provided). Instead of "Copy and Close", I just clicked on another option "Close" and hence the issue.
Just an additional input as i also encountered this issue and spent a whole day of finding the fix.
Let me just copy a line from .appinstaller file of the original poster.
<MainBundle Name="NewFileExplorer" Version="1.0.9.0" Publisher="CN=david" Uri="https://new-file-explorer.firebaseapp.com/InstallNFE_1.0.9.0_Test/InstallNFE_1.0.9.0_x86_x64.msixbundle" />
In this line, it only specify as ".msixbundle" file but the actual file in local folder is ".msixbundle.zip".
After I removed ".zip" from the filename of the file, the issue is gone.

MVC Scaffolding Error, deps.json does not exists

I'm following along with the Contoso University and I'm running into the HP Computer Platform issue mentioned in this SO question about the scaffolding creation error saying deps.json does not exists in a certain folder.
I'm running Windows 7 Professional and using Visual Studio 2017 Community.
I have changed my Environment Variable, Platform, from BPC to nothing by using set Platform= in command prompt.
Still I get an error when I try to Right Click on the Controllers folder > Add > New Scaffolding Item... > MVC Controller with views, Using Entity Framework > Fill out the form by picking a Model class and Data context class > Add >
Error
There was an error running the selected code generator:
'The specified deps.json [C:\...\bin\BPC\Debug\netcoreapp1.1\ContosoUniversity.deps.json] does not exists'
I have tried cleaning cleaning the solution, restarting Visual Studio 2017, and rebooting my computer to no avail.
Not sure what else I should do to prevent this error. Any suggestions? I feel like copying the files into the BPC folder is a workaround, but not the best solution.
Edit 1
I noticed that the Environment Variable, Platform, got reset to BPC, so I deleted it and rebooted again. Didn't come back.
Now when I try to create the scaffold I get this error:
Error
There was an error running the selected code generator:
'Value cannot be null.
Parameter name: connectionString
at
Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b_6_0()
at
Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at
Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)'
Edit 2
Setting the Platform variable back to BCP manually brings back the original error.
Copying and pasting all files from ...\ContosoUniversity\bin\Debug\netcoreapp1.1\ to ...\ContosoUniversity\bin\BCP\Debug\netcoreapp1.1\ gets me past that error, but the error from Edit 1 comes back.
Seems I have two separate problems.
Turns out I made a typo in appsettings.json
I had "ConnectionString" instead of "ConnectionStrings" with an 's'
That was causing my Value cannot be null. Parameter name: connectionString error
So, to solve my original problem, follow these steps for Windows 7. (10 shouldn't be much different):
Windows key > Right click on Computer > Properties > Advanced system settings > Environment Variables... > Under System variables find Platform > Highlight Platform > Delete > OK
make sure .json file exists in path specified. and let me know about that what you find.

Debug.Print stopped working in Visual Studio 2015

How can I ensure reliable use of Debug.Print ?
I know there have been many solutions posted for this, but none of them work. This command just keeps on being broken, sometimes it may work for a while, but generally -- it fails (see the number of SO questions regarding this). The solutions seem to vary, and yet it keeps happening - so here it is again where none of the solutions below are fixing the problem (save for installing on a fresh computer which only works for around 10 projects then fails again)
What I have tried
1. Creating a new application from scratch
2. Using the alternative to Debug.Print
System.Diagnostics.Debug.Listeners[0].WriteLine
3 Checking my app.config which shows
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
4. Checking my settings to see if DEBUG and TRACE are enabled (they are)
5. Checking that the Immediate window is on the correct tab with [Debug] selected in the drop-down (it is)
6. Ensure that I start the application in Debug mode (it is)
7. Removing all extensions / plugins.
8. Installing on a fresh computer. (works for a short period, then fails indefinitely again)
I have no AntiVirus or "potentially" conflicting software on my boxes where I test if this issue is consistent in bare windows, or if there may be another application causing it.
Are there certain cases (in the code itself like async/await etc) which consistently cause no output for Debug.Print ?
I finally found the problem. The Output window doesn't contain this output even when Debug is selected, and my Immediate window disappeared.
How to get the Immediate window back
Click the menu on the top Debug -> Windows -> Immediate or press [CTRL]+[G]
The result showing it works
Caveat: Just because you have the immediate window shown while coding, doesn't mean it will be there when you enter Start Debugging [F5] mode, or vice-versa. It may also disappear and not be there when you restart Visual Studio or start a new application. Just follow the directions above to make it reappear, and mind the other note below.
Note : After doing this, the window appeared as a floating window which I had to dock again. After docking, I tried to clear it using right-click and instead of a context menu, Visual Studio committed suicide, and then restarted - back to the project list screen (it didn't reload my project).
This didn't work for me, what finally got it working again was Project Properties> Build Check Define DEBUG Constant
One easily overlooked possibility is that the project hasn't configured any trace listeners.
Either configure one in the config file or add:
Debug.Listeners.Add(New DefaultTraceListener)
in your code.
This will cause debug output to be written to either the output window or the immediate window depending on your Debugging settings ("Redirect all output text to the immediate window").

windows phone 7 xap packaging

When I try to change the tile notification I got this message and then I deleted what I wrote but still have the same message ? Is there anyone take this error message before ? Thanks
Error 1 Xap packaging failed. The item metadata "%(FullPath)" cannot be applied to the path "res://StartMenu!AppIconGeneric.png". The given path's format is not supported.
I got exactly same error message and updating the icon / tile files to something that truly exists on the disk did not immediately help.
Closing and restarting Microsoft Visual Studio 2010 Express for Windows Phone fixed it.
This error occurs when your project contains a resource that is not existant on your disk, eg. when it was deleted in windows explorer.

Resources