How to fix Error Code CS0433 in Visual Studio 2015 - c#

I have a friend who has made some code in visual studio. But when I run his code (after getting it with git), I get Error Code CS0433. The weird thing is another guy on our team can get the exact same code and run it just fine on his computer. Here is a screen shot of the errors:
CLICK HERE FOR A BIGGER PICTURE
What is even more weird, another friend working on a different branch also gets Error CS0433 when running his code. But I can get it and run it just fine on my computer.
I have tried a couple of things to no avail.
Rebuild the solution
Clean solution
Manually deleted bin and obj folders, then do a clean/rebuild
I looked around the web for a solution. I found some people with similar problems, but theirs are in ASP.NET and not .NET. See here and here.
I have also taken a look at the documentation at MSDN on error CS0433. But I'm a beginner find MSDN's explanations very cryptic...
Is there anyone who has an idea as to what is causing this problem and/or a solution on how I can fix it?
If you need additional information feel free to write a comment. I will supply it as fast as I can.

You have references to dotnetcore50, and system.dll. This is causing (I think) most of the problems.
Try removing all the dotnetcore50 references. Start with vanilla .NET and try and migrate to the core libraries slowly. This [blog.marcgravell.com/2015/11/… might help.

Related

VS2017 Page is not supported in a Windows Universal project

I have a rather unpleasant problem since yesterday...
I cleared my NuGet chache because I couldn't get a NuGet-Package to work with one of my codes. But it didn't help and instead f***ed up the UWP apps I wrote before that.
I get errors for every element I have in my code like this:
In XAML it's mostly "XXX is not supported in a WIndows Universal project" and in the .cs files its a lot of "Cannot resolve symbol XXX"
How can I repair this?
I can compile and run my code just fine but I can't work with the code when everything gets detected as an error in VS and I can't see my UI while designing it...
I could really need some help here :/
Just putting this here... I had the same problem suddenly.
Updating the NuGet package for Microsoft.NETCore.UniversalWindowsPlatform fixed it for me instantly.
Ok I don't really know why that happend but I found my answer...
I tried restarting VS which didn't solve problem.
I tried restarting my PC which didn't solve problem.
I tried to build my code which didn't solve problembut no errors while building.
I tried to run my code which didn't work but app opens without a problem.
Next step confuses me a bit...
My Code is divided into 2 projects. One for all the XAML files and one for all my code files like Helpers, Converters, Collections...
I opened the NuGet-Manager in the second project and looked for possible updates to my packages. There was an update for the Fody-Package which I installed right away. Now everything seems fine again...even in the XAML project...
I don't understand why it works but it does :/

fckEditor, CKEditor 100's of errors C#.NET

I recently upgraded an old C# application to 4.6 framework so that I could consume a vital service that was moving to 4.6. After I did that my fckEditor had 102 compile errors. This did not make any sense because it had been working just fine for years. So, I upgraded to CfEditor and I still have 102 errors.
An example of one of the errors is:
'addedCount' is not declared. It may be inaccessible due to its protection level.
I have that type of error around 20 times.
All the errors are in the CFEditor code. Any advice on how to fix this?
Did you change the target framework version for the package? Try doing that and cleaning and rebuilding your solution. If you're using Visual Studio, this has caused me problems in the past after applying a dramatic change like updating framework version. Try restarting the editor as well.
I am assuming that this place you're having an issue with is resolved via a package manager. Please give more context if this isn't the case.
Thanks for replying. Last night, right before I stopped for the day. I removed the folder and the DLL and then added everything back in and Walla! Everything worked. It looked like the folder that I removed had stuff in it that didn't belong.

Internal MSBuild Error: Already registered for build-time

Tried to upgrade Visual Studio to 2015 Update 1 and it failed. Then started getting this error during my project build:
37>Unhandled Exception:MSB0001: Internal MSBuild Error: Already registered for build-time.
37>Error: MSB0001: Internal MSBuild Error: Already registered for build-time.
I thought it might be related to the Update 1, so I completely reinstalled Visual Studio. Nothing changed. I am able to build my solution (which has a mix of C# and F# projects) if I build the problem F# projects one at a time. But doing a rebuild on the entire solution gives me this error. Any idea where I can begin looking for answers?
thanks
So I got this problem when upgrading VS 2017 to version 15.8.0, and googled my way to a workaround. Although initially reported for VS 2015, and probably caused by another bug at that time, I have a feeling several developers will land here in the next few days.
A workaround is to set concurrent builds to 1. This can be done in VS 2017 in Tools/Options/Projects and Solutions/Build and Run, and then you see it at the top in the settings pane.
This obviously will slow down many builds, but for some of us it's probably easier (or perhaps needed) to use this workaround rather than downgrade while we wait for a fix, which I guess won't be long.
Turns out the problem was with Modeling project. Unloading this project fixed the problem. I still believe there is something wrong with the build process, but that's not something I care to troubleshoot at this point. Hope this helps someone else

VS 2008 suddenly can't start debugging session

I am having great problems running the application in the debugger from Visual Studio 2008.
When I'm using vshost.exe, it says:
And when vshost.exe is turned of, it simply states:
Interesting thing about it is that when i do use vshost, debugger is actually started and breakpoint is hit on the first line of the Main().
I tried:
rebuilding the project(s)
removing .ncb, .suo, .user for the projects
repairing Visual Studio 2008
changing the build architecture for the project
... no help there...
Any experience in (trouble)shooting that?
More info: some projects DO work, and one that I have to work on, does not.
I have some ideas such as:
trying to create NEW project, add thing by thing to it and see at what point it will start to miss behave
work it other way around, delete project by item by item to see when it will (if it will) be working OK again.
EDIT (for google, as I see that there are many similar questions on the web):
Errors:
Error while trying to run project: Unable to start debugging.
and
Error while trying to run project: Unable to start program '....\PlayKontrol.exe'
Try upgrading your Visual Studio to Service pack 1, if you haven't already.
Did you restarted your computer? You never know how windows will react to that :).
Also be sure there aren't any keys stuck, like the ctrl or windows key.
Note that the key does not have to be visually stuck, it can be stuck for visual studio and not for the explorer.
The most common source of sudden problems like this is corruption of one of the data files that vs uses to cache information between builds.
You've tried a clean build, but this won't delete everything. A real clean build is: quit vs, delete bin, obj, debug, release folders, delete all generated files in the root - primarily ncb. Do the same for any locally built libraries that you're project references.
The easiest way to do this is if you have the code in source control, as you can rename away your entire code folder and then force a get of all the source.
You often need to do all of these things in one hit to clear the problem.
Less frequently, a reinstall of vs will sort things out (although this sounds unlikely in your case if it is only one project that breaks)
Also think carefully about anything you might have installed just prior to it failing... And remember that some install effects may not occur until the next reboot so it could be days ago. A particular cause of this are automatic windows updates and trial versions of things like the vs 11 beta.
You might try running the application from outside of VS, but have a line of code that looks like this: Debugger.Launch(); where you want your first breakpoint.

C# Console Application failing to run

I am using Visual Studio 2008 Express and I tried creating a simple console application to test it. When I try to compile it, it compiles fine, but when I try to run it, it complains about the absence of a manifest file. As far as I know, VStudio should create the manifest file automatically, but since it is a simple console application without any dependencies, I asked VS to create the application without a manifest. It didn't change a thing. It kept asking for a manifest file saying that the application was supposed to have one. I remembered old bugs from the vshost process from previous VS Express versions so I tried disabling it. When I did, the error message changed to say that the application failed to load properly and would be closed, both with the option to create a manifest or not. I am pretty sure it is some misconfiguration on VS Express on my part, but I couldn't really find where. Anyone had any similar problems?
I think you should just create the manifest file. It's like 30 seconds to set up and I'm sure you have wasted much more time by googling and trying to solve the issue.
Here's the MSDN article about assembly manifests (in .NET 3.5):
http://msdn.microsoft.com/en-us/library/1w45z383.aspx
EDIT & note for the person who downvoted this answer: This is a helpful answer, and I tell you why. When implementing software projects, sometimes we all make mistakes and waste a lot of time by trying do something in a way that just doesn't make sense. It is a very important engineering skill to be able to realize that "I'm doing it wrong" as early as possible and not try to force a non feasible solution.

Categories

Resources