Has anyone faced this ... Was working fine a week ago.
Steps I tried:
Re-installed the installer
Re-installed Visual Studio 2019 Enterprise
Ran several repairs from the installer
Clean install.NET 3.1 Framework / .NET 5.0 Framework / VS Framework (basically all the frameworks)
Delete obj & bin folders and build
Deleted and installed all packages (installer was failing due to Debuger/Remote package being corrupted)
It fails the build every time there I'm trying to get a list by direct index as in the picture below e.g. wagons[i]
This is where it says it fails:
So after all a simple check for a windows update, updating and installing with a restart fixed it. As far as I could judge the C# compiler csc.exe file was misbehaving.
Could be worth a try if anyone else experiences a similar glitch
Related
I am getting the error: "Could not find SDK "Microsoft.VCLibs, Version=14.0" whenever I attempt to build the default "Blank App (Universal Windows)" app.
I know I have compiled UWP apps before, and is potentially a consequence of recently trying the VS2019 preview (now removed)
I've tried uninstalling/reinstalling VS2019, VS2017, even installed 2015 and the blank UWP apps in each all come up with the same error.
I've tried uninstalling/reinstalling/repairing Windows 10 SDK's.
I've tried various versions of the Microsoft.NETCore.UniversalWindowsPlatform to no avail. (The default is v6.2.10).
Can anyone explain how I can logically chase this error? I'm assuming that it is failing to build the UniversalWindowsPlatform nuget - is this correct? What is supposed to be installing the vclibs extension? How can I see what is preventing it from being installed?
No amount of repairing/installing VS2019, VS2017 or even VS2015, adding or removing options, (re)installing SDKs, (re)installing Visual C++ Runtime libraries made any difference.
what did eventually work was installing VS2019 on a new PC and then copying its entire "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs directory across.
If installing VS2019 installs this directory, I'm not sure why it doesn't fix it as part of reinstalling and/or repairing it!! An opportunity for improvement in VS2019 repair perhaps?
Big thankyou to #NicoZhu-MSFT for all of your help!!
I am trying to develop a UWP app for Windows desktop machines. Everything has been going well, but within the last few days I've lost the ability to build a release version (building a debug version still works fine).
I get the following error messages:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(2810,5): error APPX0002: Task 'ValidateAppxManifest' failed. Unspecified error
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(2810,5): error APPX0002: [My App] violates pattern constraint of '\bms-resource:.{1,256}'.
I've tried a number of "fixes" that worked for people over the last few years. Some people report the problem fixed itself in the latest version of Visual Studio. Unfortunately, the versions they mention are older than the version I'm using, which is
Microsoft Visual Studio Community 2019
Version 16.6.3
Many fixes from the net are similar to the ones below, from the URL
https://social.msdn.microsoft.com/Forums/en-US/4cc2cbfb-fa0d-4f12-a0a1-9072d78e26d6/vs2019-error-task-validateappxmanifest-failed-unspecified-error-again-and-again?forum=msbuild
One fix was:
Clear nuget packages,
Clean solution
Close VS
Delete bin & obj folders of the main (startup) project
Open VS - solution
Restore solution nuget packages
Rebuild 'n go
Another fix was:
uninstalling vs & sdks,
removing every nuget folder,
clean the registry and restart the system,
the last step once more,
reinstall vs.
I have tried all of these (several times) except for "clean registry." I'm not sure what part of the registry we're talking about.
So, has anyone overcome this problem in a different way, or know what the registry idea is?
Oh, some other data is
Maybe my machine is too old (about 6 years old). I’m speculating that even if my machine seems to have the latest version of Windows an Visual Studio, maybe it doesn’t have exactly the latest code.
Things went bad while I was adding two new features. The first was to ask the user for a rating, via _storeContext.RequestRateAndReviewAppAsync(); The second was allowing the user to share some data via DataTransferManager.ShowShareUI();
I was thinking maybe these APIs might require some declarations in the manifest that I don't have, but I don't see from the documentation that they do.
Any ideas would be greatly appreciated. I’m out of ideas at the moment.
Dan
Here is the answer, for me. I’m not confident that this as the answer for all cases, but all is good now.
You may remember that I said I had the latest version of Windows, and I did. However, when I checked with Windows Update last night, it confirmed I was “up to date” but it offered me a “Feature update” to Windows 10, version 2004. I decided to go for it.
The update took hours to complete, and this morning it was still only 94% complete when Nico Zhu suggested to try using Visual Studio 2017. I figured I’d install VS 2017 after the update, but when it was finally complete, I decided to try VS 2019 one more time with my fresh new version of Windows. Amazingly, it worked the first time.
I should mention that my new procedure for making an app package now includes
close VS 2019
delete the project’s obj folder
delete the project’s bin folder (I used to just delete the obj folder, but after seeing others suggestions I’ve added this step)
launch VS 2019
create the App Package
I wanted to do another build/package so I fixed a couple of cosmetic bugs and tried again. On the second try I fell back into my old pattern and I did NOT delete the bin folder. Immediately VS 2019 popped up with an error message something like “Cannot complete build. Fix problem with your app manifest.” Rather than pouring over the manifest file as I’ve been doing for the last couple of days, I deleted both the obj and bin folders and tried again. The build/package process then worked perfectly.
So, I want to say that the app manifest file was not the culprit (in this case anyway) and I’m now a fan of deleting both the obj and bin folders, and having Win 10 version 2014, before attempting a release build with VS 2019.
Dan
I have an MVC5 application which I'm trying to run offline. I installed VS2017 offline but when I try to build the project it throws multiple errors relating to it missing all the .NET assemblies and dlls. When I try to add these assemblies they're not available to be added. Anyone please help.
PS: there's NO internet on the machine.
I also have that problem from time to time. What usually helps is to do a dotnet restore. This is different to running restore from the solution explorer within VS, you have to do it through the command line. In order to execute it, you need to have the .NET Core SDK installed. dotnet restore is usually very good at fixing some project problems such as corrupted .json files that VS creates behind the scenes and I would guess that it is able to repair those files without internet connection, but I haven't tried.
Try cleaning and rebuilding your solution. I had this issue and something went funky with my dll's.
It's obvious omnisharp error same as mine. I changed omnisharp path version from c# extension(c# > unistall > install another version) and reopened to vscode. It worked for my project. All error has gone.
Getting the following error 'The target "MainResourceGeneration" does not exist in the project' on Any project I try to build with Visual Studio. Cannot run debugger, cannot build/rebuild solution or projects.
Backing up a bit:
I had VS2012 and VS2017 (always used 2017) installed.
Got an error that pointed me to the Microsoft.Common.CurrentVersion.targets file. I mistakenly edited this file thinking it was part of my project.
Started getting the aforementioned build error on all my projects. Including simple, brand new, unaltered C# .NET framework console app.
Also had the same error on VS2012...
Tried VS2017 repair.
Tried VS2017 uninstall/reinstall.
Tried uninstall VS2017/2012, manually delete visual studio program files folders, reinstall 2017.
Still have the problem. Brand new fresh VS2017 install and not even a new console app will build.
Build output just shows this...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2789,7): error MSB4057: The target "MainResourcesGeneration" does not exist in the project.
Visual Studio Build Error: The target “MainResourceGeneration” does not exist in the project
Since this issue still occurs on a new console app, it seems that the Visual Studio installation file is corrupted. You can try to following steps to clean up the Visual Studio and reinstall it:
See if you have this file on your machine:
"%programfiles(x86)%\Microsoft Visual
Studio\Installer\resources\app\layout\InstallCleanup.exe"
Start an admin command prompt
Right-click on cmd.exe and select Run AsAdministrator
If so, please launch it from an admin command prompt with a -full
param
InstallCleanup.exe -full
If not, please manually delete the "%programfiles(x86)%\Microsoft
Visual Studio\Installer” folder
Verify that your initial install location for VS is removed. If it
is not, delete it manually.
Relaunch the newly downloaded vs_enterprise.exe (or
vs_professional.exe or vs_community.exe…)
Allow the first step to install the installer Once the installer
comes up and you can see workload choices (.net desktop and the
like), close it
Go launch the same InstallCleanup.exe to clean up old build of VS
Then relaunch vs_enterprise.exe and install VS
Please let me know if it works for you.
I tried several further steps like manually deleting Visual Studio related folders in my Users and ProgramData directories, and repairing .NET framework. None of those changes worked. Still had the same issue.
As a last resort I fully uninstalled .NET Framework (4.7.1) and grabbed the latest version (4.7.2) from https://www.microsoft.com/net/download/dotnet-framework-runtime. I no longer received the error and could then build my projects again.
I do not know or understand the root cause, but a full uninstall/reinstall of .NET framework fixed it...
Since yesterday I am getting a weird error when I try to create a new .Net Core Web project. The error I am getting:
It seems this is only the case for .Net Core projects (Console application .Net core also doesn't work but a regular .Net web project does work...
I looked online but it seems there is no documentation about this error whatsoever.
Some things I tried already:
Repairing Visual Studio 2017
Checked the log by running Devenv /log (Warning :
Performance warning: String load failed. Pkg:{D15F5C78-D04F-45FD-AEA2-D7982D8FA429} (VisualBasicProjectSystemPackage) LANG:0409 ID:2
)
UPDATE
I think I know what caused the problem. Prior to the problem I deleted my old user account (migrated the account so everything copied to a new user account), my guess is that Visual Studio also installs templates on my user account and with the removal of my old user account I also deleted some templates. The question however is, why is the .Net Core template the only one not working then?
Anyone know what causes this problem and how to fix it?
Removing Visual Studio and reinstalling it seems to fix the issue. Before reinstalling, make screenshots of all your settings and (manually) downloaded components.
Same problem here, I tried to repair (multiple times) the installation but the problem wasn't solved.
In my case I didn't change user accounts.. I just uninstalled VS 2013 Ultimate, Unistalled VS 2015 (with some difficulty) and then installed VS2017..