VS 2013 suddenly showing projects failed to load - visual-studio-2013

I am getting below error suddenly for all projects. Any idea what could cause this issue. Everything was working till morning.
The project file could not be loaded. The '`' character, hexadecimal value 0x60, cannot be included in a name. Line 1635, position 10. C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets

Resolved .. Somehow my vs 2013 target file at below got corrupted by some junk characters
( C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets).
As mentioned in the error issue was at line number 1635 .

Related

Why do I get an error when building Solution in VS2017

For a while now I've been getting the following OUTPUT window when building a solution:
1>------ Build started: Project: Scheduler, Configuration: Debug Any CPU ------
1> Scheduler -> C:\Users\dubilm\source\repos\scheduler\Scheduler\bin\Scheduler.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4811,5): error MSB3541: Files has invalid value "<<<<<<< HEAD". Illegal characters in path.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have tried Clean and Rebuild to no avail. The application works despite the reported error and updates have been deployed to production server with no issues. None of my other solutions/projects have any issues building.
The ERROR LIST window also lists the same error...
Severity = Error
Code =
Description = Files has invalid value "<<<<<<< HEAD". Illegal characters in path.
Project = Scheduler
Path =
File =
Project Rank = 1
Line =
Column =
Category =
Source = Build
Suppression State =
Tool
So no file indicated as the source of the error. The project is a web application .net vb MVC if this has any bearing.
Any suggestions of what else I can try to clear this error. Thanks
The <<<<<<< HEAD is what you get when trying to merge files, its used to indicate where the code starts (the old and the new one) sometimes when merging, some issues happen(ther could be a ton of diferent reasons) and you get stuck with that in the middle of your code, just use the search function (Ctrl + f) and search for <<<<<<< HEAD (make sure you had the search option in "search in this solution") you will see where it is, and if there is no duplicated code around, you can just erase it
I deleted the "bin" and "obj" folders and then cleaned the solution. It worked for me. Hope this will help.
Try unloading and reloading project. That worked for me.

The specified path, file name, or both are too long when deploying WebJob to Azure

I've recently upgraded a project to .NET Framework 4.6.1 and now am having issues when trying to deploy to Azure as a WebJob. I'm getting the following error:
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(2603,5):
Error : Copying file
C:\Users\XXXXXXXXXXX\Documents\Source\Workspaces\XXXXX Server
Application\ServerApplication\XXXXXXXX.IntegrationService\bin\Release\Microsoft.Extensions.DependencyInjection.Abstractions.dll
to
obj\Release\Package\PackageTmp\app_data\jobs\continuous\XXXXXXXXIntegrationService\Microsoft.Extensions.DependencyInjection.Abstractions.dll
failed. The specified path, file name, or both are too long. The fully
qualified file name must be less than 260 characters, and the
directory name must be less than 248 characters.
I'm confused by the error as the path and filename are only 189 characters combined:
C:\Users\XXXXXXXXXXX\Documents\Source\Workspaces\XXXXX Server Application\ServerApplication\XXXXXXXX.IntegrationService\bin\Release\Microsoft.Extensions.DependencyInjection.Abstractions.dll
If I remove the Microsoft.Extensions.DependencyInjection.Abstractions.dll from my project I can then deploy as normal. I've tried cleaning the solution and restarting VS.
I'm confused by the error as the path and filename are only 189 characters combined
That because event if the error as the path and filename are only 189 characters combined in below path:
C:\Users\XXXXXXXXXXX...bin\Release\Microsoft.Extensions.DependencyInjection.Abstractions.dll
But when we publishing the project, VS/MSBuild will copy this file to the path:
obj\Release\Package\PackageTmp\app_data\jobs\continuous\XXXXXXXXIntegrationService\Microsoft.Extensions.DependencyInjection.Abstractions.dll
So the full path and filename should be:
C:\Users\XXXXXXXXXXX\Documents\Source\Workspaces\XXXXX Server
Application\ServerApplication\XXXXXXXX.IntegrationServiceobj\Release\Package\PackageTmp\app_data\jobs\continuous\XXXXXXXXIntegrationService\Microsoft.Extensions.DependencyInjection.Abstractions.dll
Then the path and file name are about 260 characters combined, so VS/MSBuild could not access that path. To resolve this issue, you can try to move your solutions/projects to the the root directory, like:C:\Workspaces

i keep getting the error on xamarin studio that tells me the dll.mdb is missing. Isnt it supposed to be automatically generated? How do i fix this?

C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(5,5):
Error MSB3030: Could not copy the file "C:\Users\Tolu\Documents\ICE
Dialler\Dialler1\Dialler1\Dialler1\bin\Debug\Dialler1.dll.mdb" because
it was not found. (MSB3030) (Dialler1)

Name cannot begin with the '$' character, hexadecimal value 0x24

I have this warning that never goes away and I don't know how to get it fixed:
Warning Name cannot begin with the '$' character, hexadecimal value 0x24.
.Android C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1668 Build
After enabling detailed verbosity, it points to this section of the Xamarin.Android.Common.targets file:
<Target Name="_GenerateJavaStubs" DependsOnTargets="_SetLatestTargetFrameworkVersion;_PrepareAssemblies;$(_AfterPrepareAssemblies)" Inputs="$(MSBuildAllProjects);#(_ResolvedAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache)" Outputs="$(IntermediateOutputPath)android\AndroidManifest.xml;$(_AcwMapFile);$(_AndroidTypeMappingJavaToManaged);$(_AndroidTypeMappingManagedToJava)">
<GenerateJavaStubs ResolvedAssemblies="#(_ResolvedAssemblies)" ResolvedUserAssemblies="#(_ResolvedUserAssemblies)" ManifestTemplate="$(_AndroidManifestAbs)" MergedManifestDocuments="#(ExtractedManifestDocuments)" Debug="$(AndroidIncludeDebugSymbols)"
NeedsInternet="$(AndroidNeedsInternetPermission)" AndroidSdkPlatform="$(_AndroidApiLevel)" AndroidSdkDir="$(_AndroidSdkDirectory)" PackageName="$(_AndroidPackage)" ManifestPlaceholders="$(AndroidManifestPlaceholders)" OutputDirectory="$(IntermediateOutputPath)android"
MergedAndroidManifestOutput="$(IntermediateOutputPath)android\AndroidManifest.xml" UseSharedRuntime="$(AndroidUseSharedRuntime)" EmbedAssemblies="$(EmbedAssembliesIntoApk)" ResourceDirectory="$(MonoAndroidResDirIntermediate)" BundledWearApplicationName="$(BundledWearApplicationPackageName)"
PackageNamingPolicy="$(AndroidPackageNamingPolicy)" ApplicationJavaClass="$(AndroidApplicationJavaClass)" AcwMapFile="$(_AcwMapFile)">
</GenerateJavaStubs>
<ConvertResourcesCases ResourceDirectories="$(MonoAndroidResDirIntermediate)" AcwMapFile="$(_AcwMapFile)" />
</Target>
I have no idea if I need to modify this or if one of my files is causing the issue. I double checked, none of my files actually start with a $.
Any ideas?
Thank you.
Seems to be a Xamarin bug, at least in some circumstances. Logged Github issues here and here with repro steps and a sample project.
Try this:
Open Windows Task Manager -> Go to the Details Tab
End all MSBuild.exe tasks you may find
Go to your project folder, delete Bin & Obj folders (SHIFT+DEL)
Close Visual Studio completely
Open Visual Studio again, open your solution, rebuild.
OR this:
Open Project settings
Go to Android Manifest
Make sure your Version number doesn't have dots or commas
Looking through the diagnostic output of Visual Studio, I could see a lot of '\$' occurrences, most of them related to Google Play.
For me, the solution was that I had forgotten to install Google Play in the SDK Manager (under Extras).
For me, a Visual Studio 2017 update did the trick.
Now it is only a warning anymore.
Name cannot begin with the '$' character, hexadecimal value 0x24.
VS 17 update from 15.4.4 to 15.7.4 was done.
I have experienced this error on Android, and what I have done to make it works is: "Version Number" should be a number and it should not contain the dot.

Visual 2010 MFC new project doesn't build!

I just created a new project in Visual 2010. It is a multi-document MFC (static link) application with the HTML help option, Visual Studio 2008 style (with style changing option), that's about it.
Just after creation, I hit Build Solution and I get a lot build errors all in afxcomctl32.h. Errors like:
Error 1 error C2061: syntax error : identifier 'LPCWS' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcomctl32.h 426 1
On this line:
AFX_ISOLATIONAWARE_STATICLINK_FUNC(HWND ,CreateWindowExW,(DWORD dwExStyle,LPCWS TR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam),(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam),NULL)
Same errors in Debug and Release.
My PC is Windows 7 Ultimate. What's the problem???
Best regards,
Downy
AFX_ISOLATIONAWARE_STATICLINK_FUNC(..., LPCWS TR lpClassName, ...)
That code got messed up, there is a space or tab inserted in LPCWSTR. Deleting it will fix the problem.
However, that changed the timestamp on the file as well, you may run into trouble when you install a future service pack. One thing to try is to rename the file, then run a Repair to get the original file back. Or copy it off another machine.

Resources