UWP initializeCompontent Error - c#

I changed all the namespaces in my app. It was a grueling process. but now my app won't build because of this error. See the attached screenshot.
Can anyone help me fix this issue?

You must have missed something. I just tried this on a new solution, and it worked fine, using Visual Studio 2015, Update 1.
Create new UWP app (ILoveBurritos)
Rename namespace using F2 to ILoveTacos
Resulting app still compiles and runs

Related

System.BadImageFormatException Error on VS Code Startup

I am in the process of getting everything I need to start learning C# and I've run into an issue. I am trying to use VS code as my editor but the IntelliSense isn't working. I think it's because OmniSharp cannot start up. When it tries to it run into this error: System.BadImageFormatException. I'm doing this on a brand new project, literally, all I've done is run the command dotnet new console and then OmniSharp cannot open. If it's relevant I'm using Mac and have the latest updates installed. Any idea what's causing this error and how I can fix it?
Thank you for any and all help!
Ok, so after some trial and error I realized I was using the wrong sdk. So, if anyone else is having this problem make sure you have the right one! I ended up needing the Arm one and not the normal one.

Visual Studio cannot start debugging because the debug target is missing. error still continues

Visual Studio cannot start debugging because the debug target is missing
I looked up a lot of solutions for this error, but none of them worked for me. I tried everything, but still I have no solution.
When I click run, this infamous error message shows up.
I have set my output path to the correct folder, and everything. nothing works
please help!
Try this one:
right click solution -> Property -> Configuration Properties ->Configuration -> Enable project in Build
from visual studio development center
Hi this happened to me after I renamed Form1. I tried Bulding/Rebulding/Cleaning the Project, changing the path etc. but nothing worked. The Debug folder of the project was empty and then I saw that there is error in the Program.cs, the old name of the form was not updated to the new name. So in the Program.cs change the Old name with the new Form Name. This Solved my problem and now the application is working.This could be the problem if you are using Win Forms.

Microsoft.Build.Utilities.ToolLocationHelper::GetPathToStandardLibraries(MonoAndroid) - How to solve this?

After installing Visual Studio 2017 version 15.6. Preview, I'm not able to create Cross Platform project. Every single time, I'm getting error from the picture. Any solution for this?
It's actually a bug of Xamarin Visual Studio Template, see bugzilla 60995, a temporary workaround is provided for this bug:
Workaround:
Apparently when the template is generated it'll add the following line in the android csproj file:
<TargetFrameworkVersion>"v8.0"</TargetFrameworkVersion>
The solution then is to change it to:
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
Without the quotes and after that, everything works fine again!

Unable to start debugging. The startup project could not be launched. VS2015

I have started a new console project in VS2015. I only have this code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SautinSoft;
namespace PdfParser
{
class Program
{
static void Main(string[] args)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
SautinSoft.PdfFocus f = new PdfFocus();
f.OpenPdf(#"path:\abc.pdf");
if (f.PageCount > 0)
f.ToExcel(#"path:\abc.xls");
}
}
}
When I try to run, I get this :
Unable to start debugging. The startup project could not be launched.
Verify debug settings for the startup project.
How can I fix this? Thanks.
After upgrading MSVC2015 to Update3, I had the same problem: instead of std::map in the Watch window display as a horrible std::_Tree<std::_Tmap_traits... etc., some plugins started to throw exceptions, some projects was not able to run in debug mode.
All was solved by deleting CurrentSettings.vssettings. It is usually located at Documents\Visual Studio 2015\Settings If not, go to `Tools -> Options -> Environment -> Import and Export Settings ' to find the location of this file.
Had this on a brand new scaffolded ASP.NET Core 1.0 web application.
Solved with restart of Visual Studio.
I was also stuck with this. I removed both bin & obj folders, did a rebuild, and then it launched.
A very meaningless error....
I had this problem when I tried to start (without) Debugging my Asp.Net MVC project
are you running Visual studio as Administrator
so just restart visual studio As Administrator
Additionally to "Unable to start debugging"
I also had errors "The operation could not be completed: Unspecified error" when I tried to rebuild.
Thanks to Visual Studio popup: "the operation could not be completed"
it was enough to close Visual Studio 2015 and then open again.
Make sure you're launching Visual Studio as Administrator.
Right click on the Visual Studio 2015 Shortcut
Select the Shortcut tab
Click on Advanced
Check the box to "Run as administrator" at all times(see below)
This has resolved the issue for me with the exact error message in question.
It is not ideal to run the VS in administrator mode at all times. Make sure you un-check the box once your issue has been resolved.
There is no need to delete everything in my case, I just opened the
"CurrentSettings.vssettings"
file and commented this property
<PropertyValue name="DefaultBehaviorForStartupProjects">1</PropertyValue>
and everything fixed.
Sample
Just delete the .vs hidden folder. This folder resides at the same location where the sln file is. Deleting this folder also refreshes intellisense cache and would fix any issues with that. Hope this helps.
VS 2019, two Core 3.1 projects (an MVC and an API), brand new projects created, no other changes to the solution or projects.
I kept getting the referenced error when trying to start both projects within the IDE, despite having checked all the things already mentioned in this SO.
However, I finally realized, I forgot to specify the "Action" after switching the solution to "Multiple startup projects" (they were both still set to "None"). Right-click solution in "Solution Explorer", choose "Properties" (at very bottom).
Such a ridiculously simple thing. Hope it helps someone else.
"Broken"
Working
I just had the same problem and solved it by deleting the .vs directory in the project directory.
Delete all relevant /obj and /bin folders. Run again.
Close the Visual Studio and re-open it again.
Just restart your visual studio and run as admin.
I had this with a Xamarin.iOS project in my Xamarin.Forms solution. I tried every suggestion here, without success.
The source of the error was a misconfigured .csproj of the project. I never edited it myself and not even touched the project properties. I use Visual Studio 2017 RC.
I came across the solution when I compared the project file with previous versions on Source Control.
Solution: Compare the project file with a previous version and try to granually revert changes until you eliminated the problem and know what the cause was.
The solution for me was to delete all *.user files that are normally generated for both solution and project files
I found this problem too. But after restart the Visual Studio Community 2015 as an administrator I found new problem :
And then I try to open another solution, close the another solution, and open the solution which the problem occur, then the problem solved.
Had the Same Issue with the existing application, I deleted the vs settings but still the issue remained,
Finally i just restarted the VS and it worked fine.
I think sometimes when we load the project some library doesn't get loaded with the solution so the best option before doing anything is simply restarting the VS.
After adding a project reference 'MyProjectReference' to my app, then removing it, I was also getting the same error :
Unable to start debugging . The startup project could not be launched.
Verify debug settings for the startup project.
Deleting configuration, running as admin, restarting VS, rebooting machine all had no effect.
After running my web app without debugging (Right-Click Project -> View In Browser (Google Chrome) I got a much more useful error:
Could not load file or assembly 'MyProjectReference' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
My Solution was then to re-add back to the solution, then remove it again. After that rebuild and debug worked.
How I fixed my issue, I closed project that had that error , created new project build new project then opened the project that had an issue and build it. That worked for me.
Make sure you close all instances of Visual Studio and then restart as Administrator. In my case I had multiple instances of Visual Studio open and I had to close them all and then restart Visual Studio as admin in order to get things working.
I had visual studio 2015 with an ASP.net MVC5 arcitectured with DDD (Domain Driven Design). The problem was the same since I just opened visual studio normally.
The problem was solved when I closed all instance visual studio and restarted as an adminstrator.
I also faced to this issue in VS 2015 , but finally I resolved it by following bellow steps
In VS go to : Tools -> Options - > Projects and Solutions -> Build and Run
Select "Always Build" in "On Run when project are out of date"
This issue happened to me with the Latest VS2019.
I've tried everything here, but unfortunately without any result.
Finally, I've restarted the IIS server, also manually Recycled the "Default Application Pool".
After debugging issue fixed.
For me solution was to run testapp.csproj instead of testapp.sln. This can be selected from drop down next to green play button.
Simply updated visual studio which then prompted PC restart. This is what fixed the problem for me.
Note: I tried some of the above / below but to no avail.
I got this problem solved by clearing MEF component cache.
Use this VS Extension to clear cache very easily.!!
I stop debugging and exit the projects from IIS Express then clean and build the project and my error is gone.
I get this running as non-Adminsitrator in Visual Studio 2019 16.2.5, with two .NET Core projects.
The solution I found is to set at least one of the projects as "Start" (in Solution's Property Page). If both are set to "Start without Debugging" it fails. This happens even if I want to start the entire project without any debugging (Ctrl+F5).
Bug. Still unaddressed by Microsoft and their bug page issue report it is closed as unreproducible.
#Flowerking's commend did it for me.
Right click on you project and select "Set as StartUp Project".
I had this problem developing a react native app for windows in Visual Studio 2019. I started the debugger then stopped it in the terminal by using ctrl-C. I was not able to restart the debugger and the "start debugging" and "start without debugging" options were disabled in the debug dropdown. Restarting Visual Studio, etc, and some of the things described above did not work. Through hunting and testing, I noticed that if I switched views in the Solution Explorer to the MyProject.sln instead of the fileview, the debugging was enabled again. I'm not sure why, but it appears I need to be in the sln view to start the debugger.

windows form dont start on other machines and process can't be closed

I've got a problem with my windows form application.
I wrote a simple program that can create .VTF / .VMT files out of .TGA files and can generate a .QC file and also compile this all with a .SMD file into a prop for the sourceSDK (Hammer Editor). So i can use this to bypass the incredible annoying task with compiling custom models for a map in Counter Strike.
Previously i could compile my form (same with other applications) and send it to someone so he can use it. This time it compiles normal and works fine on my system, but after i sent it to my friend it didn't start. He clicked at the .exe and his explorer.exe froze. After some time his explorer came back but he couldn't move or delete the file.
He also tried to restart his system, but afterward it still refuses to delete the file and then bluescreen. (The bluescreen said something about an Errorcode = 0xc000021a)
An other friend tried to start the .exe too, but he got the same problem with the explorer ...
I use Visual Studio 2015 to write and compile my code. My target Framework is .Net 4.5.2.
Does someone know how to solve this problem?
What further information do you need?
Thank you for your help
Greetings
Marv
EDIT #1: I think the bluescreen isn't that important for that problem.
We tried it again with serveral .NET Versions and it won't work at all.
The funny thing is that i sent him the whole Visual Studio project and told him to compile it on his system. The debug version in Visual Studio works fine but if he wants to start the release.exe in the subfolder /bin/release/ the same problem occurs..
Ok, i found the solution to this problem with some help from here:
C# exe not starting on Win7 build computer
and here:
Executing the Visual Studio created *.exe does not open a window and the process can not be terminated
He only has to turn off his avast antivirus...
EDIT #1: I found out that disabling the "Deepscreen" feature in Avast is enough to solve this problem.
Thank you for your help

Categories