Xamarin.forms with Visual Studio stopped showing error messages - c#

I'm working on my first Xamarin.forms project and Visual Studio seems to be doing everything possible to slow down my progress on this. From the start I've not had any intellisense support for the xamarin.forms or my own objects, but after trying many suggested fixes I've just about learnt to live with this.
However, now Visual Studio has stopped even giving me error messages, something which up until now it was doing. On my computer I've got installs of both VS2015 & VS2017. Some time last week 2017 stopped doing it, so after a bit of failing to find a solution, I went to 2015 and carried on as normal. This morning I've come in to find that 2015 now isn't giving errors either.
If my project is free from compile errors then my project will build and run on my android device as expected, however, if there are any compile errors, then I get the error list tab popping up showing 0 errors and 3 warnings (the warnings always being the same: 1 about version conflicts in dependent assemblies and 2 that file names exceed the 260 character limit within the UWP and iOS versions of the project).
Has anyone else experienced anything like this before? As you can imagine, the combination of limited intellisense and no compile error debugging makes for a pretty horrific dev experience and is seriously undermining the supposed dev time benefits of using Xamarin in the first place.
James

Ok, so after getting pretty desperate for a solution, I tried deleting the .shproj file within my shared project which resulted in visual studio displaying the compile error messages despite it not actually being able to load the project correctly any more. After restoring the .shproj file back, I am now getting error messages and able to build my project.
I don't feel particularly confident that this will be a long term solution to my problem, but for now I am at least able to get on with my work.

Related

Struggling to get started in Visual Studio and Xcode - "undefined symbol _main"

I am a beginner when it comes to coding, and I have been struggling with a very annoying problem this entire day. I hope you can help me relieve this awful headache.
My idea is to create a very simple app for my Mac, so I downloaded Visual Studio and Xcode.
I followed this tutorial from Youtube to get started, but halfway in the film I see that I am not able to get the same "outputs" as this Youtuber gets ( https://youtu.be/rj_n4W_mDN0?t=340 ). In my case it doesn't automatically provide "NSTextField*LabelInfo", but I can attach the button and label to the script and make them show when I run Visual Studio.
I am not provided this autofill either ( https://youtu.be/rj_n4W_mDN0?t=420 ) or the option of calling the "HelloPressed" function in Visual Studio.
Then I discovered that I have an error message in Xcode when I try to build it: "undefined symbol _main" (which the Youtube person doesn't have).
It also reads:
"Undefined symbols for architecture x86_64:
"_main", referenced from: implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
I deleted my code and restarted the program, but the same message popped up. I deleted both Xcode and Visual Studio, and reinstalled it, but it still came up. This time I didn't add or do anything other than opening a new projects (in Cocoa app), and still I was greeted with this annoyance.
I see that my "Main.cs" in Visual Studio is not appearing in Xcode project (all the other ones are), but I don't know if this is relevant. I have tried to add different Frameworks to Xcode (AppKit), but I still receive this message. Maybe there is something I have to do in the Build section of Visual Studio, but I don't know what.
I have absolutely no clue what to do and how to proceed. I find it so strange and annoying that the Xcode gives me an Error without me doing anything else then starting up the program. My Macbook pro is very new so that cannot be the cause, the softwares are newly updated: Xcode 11.5 and Visual Studio 8.6.5 (build 23). I am programming in C sharp
I hope you are able to advice me in what to do. I am a beginner so I would appreciate easy-to-follow assistance or instructions.
Thank you very much,
August
Sorry I can't offer a definitive answer but hopefully the following will help you find your issue. I don't usually use VS for Mac and installed it just to see if I could figure out your issues. It is not as intuitive as one may like...
Visual Studio for Mac on both Mojave & Catalina does not work appear to work as the video you found seems to show.
Double-clicking on a .storyboard file generally seems to open the file in VS's XML editor rather than in Xcode. There might be a setting to control this somewhere. To open in Xcode right-click (or control-click) the file name and select Open With… -> Xcode Interface Builder in the menu that appears.
– Once over in Xcode you may find you have two open windows, one is just the .storyboard file and the other is a dummy Xcode project containing it. Close the first of these and just edit within the Xcode project window. If you don't do this you cannot create bindings between the controls and the source. If you look at the Xcode windows in the video you found you will see that when the bindings are being made it is in the project window, but there is nothing to show how/why that window opened up at the front.
Do not try to compile the "project" in Xcode. It is not meant to be compiled and appears to just be the bare minimum scaffolding required to enable VS to use Xcode for UI editing. All the errors you got are related to this.
Searching the internet for Visual Studio for Mac and storyboard files turns up plenty of hits and these files failing to open correctly seems a common problem from a scan of the titles. Do some research and you'll probably get it to work smoothly, but it does work as is albeit a little fiddly. HTH

VisualStudio cannot run code on MonoGame

I am having issues with running code that is written in VisualStudio 2015 in MonoGame 3.5.
My two versions are compatible, from all I can see. VisualStudio has no issues running Console application codes, and also connects to Unity just fine (I can write code in VisualStudio for Unity and it runs).
I can also open up MonoGame and convert png files into xnb's to use in VisualStudio. It is only when I try to actually run the VisualStudio code and Windows tries to open MonoGame, it fails.
To better show what is happening, I created an empty project specifically by clicking "MonoGame for Windows" in VisualStudio, and called it EmptyGame. By default, running this should yield a cornflower blue screen. Instead, it shows this error message:
error message Ctrl+F5 MonoGame
I then tried to debug the completely default code (it shouldn't have any bugs as it is the default provided by VisualStudio but I did it anyway) and got this:
debugging error message VisualStudio
I have tried googling this error message and not gotten very far. Somebody had a similar error message for Duality2D (https:// forum.adamslair. net/viewtopic.php?f=4&t=732) but the answers they gave don't apply here I don't think...
I have also tried uninstalling and reinstalling both programs, making sure that I ticked VisualStudio 2015 in the MonoGame installation, and turning off my anti-virus while trying to run (Ctrl+F5) - I was desperate at this point.
Anyone got any ideas? I can't possibly be the first person to have issues trying to get VisualStudio and MonoGame to communicate, but Google has gotten me nowhere. I just found this website which had a lot of great reviews so hopefully someone here has an answer for me!
Appreciate it!
-M.

Errors/Warnings show up on "Error List" but then disappear for website project

BACKGROUND
I have inherited a solution with multiple projects. One of the projects is a website project... or at least I'm pretty sure that's what this icon means (It looks pretty different in VS 2010 vs 2013, so I'm showing both: VS 2013 on the left, VS 2010 on the right):
PROBLEM
When I rebuild the website project, there are 8 warnings that are generated. These correctly show up in the Error List, but only for a moment.
Once the build process finishes, they disappear.
There are a few things to note:
There are no filters set and I cannot toggle any of the message types because it says there are 0 of each.
Even though the errors have disappeared from my Error List, they do still show up in the output section
Warnings and errors from other projects show up in the error list without any of this weirdness
This is a website project, so the property pages are dramatically different than the ones that I'm familiar with.
I've observed the same behavior with errors
I've tried different versions of VS and they both do the same thing. I've tried deleting my .suo file. I've played around with all the settings I can find that look at all relevant but nothing changes this behavior.
What am I missing?
I had this problem this morning. After a few minutes of fiddling around, I managed to correct it by switching the "Show issues generated" combo box from "Build + IntelliSense" to "Build Only".
I appreciate this quite a subjective answer, and it may be that this solution doesn't work for you, but I suspect it may help to steer you on the right direction!
FYI, my symptoms were: The error list would show for 1-2 seconds after having built or pressed "Start", and then disappear showing 0 errors
My issue was that I was importing a reference of the class library project which was built with .NET 4.52 version and I had .NET 4.5 version. So I switched the .NET version of the class library to .NET 4.5 and the problem was solved.
Error messages didn't show this problem, but output window was displaying this error message.
Perhaps this warnings is comming from code analysis, try to run only code analysis on your solution.

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.

Categories

Resources