Error executing task XamlCTask- Xamarin - c#

I am stucking with this error for several days:
/Upackages/Xamarin.Forms.2.3.3.175/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets:
Error: Error executing task XamlCTask:
Could not find file "/Users/XXXX/obj/Debug/XXXX.dll.mdb".
Firstly, I updated the xamarin.forms, but the error was appeared again to me. Then, I clean each project and build it again, but no change has happened.
So, I am wondering what can I do? It has just shown to me since some days ago, before I could compile my project easily.

I had the same issue but using Visual Studio for MAC.
Try doing the following:
Go to "Preferences"
Then look for .Net Runtimes.
I was using: Mono 5.*
I changed my default to Mono 4.* and I was able to build successfully.
NOTE: Make sure that all the packages for Xamarin.Forms are also the same version.

Related

Error when trying to use .NET Generate Assets for Building and Debug in VSCode

I'll make this brief, below is the main issue I'm having.
I'm learning C# again so I can expand my skillset. Long story short, the tutorial I was following was showing the viewer how to use the above command from VSCode's command palette.
Whenever I try to use said command to generate the files it should, I get the error: "Unable to generate assets to build and debug. OmniSharp server is not running."
Thus far I have tried:
Uninstalling and reinstalling VSCode
Uninstalling and reinstalling the C# Extension in VSCode
Added C:\Windows\System32 to my PATH environment variable
Doing the above plus completely deleting the original project folder, restarting my computer, and remaking the simple "Hello world" print program created using "dotnet new console", inside of a workspace.
I am using:
Windows 10 Pro
Visual Studio Code 1.48.2
.NET SDK 3.1.401
I'm not sure what other information may be necessary, and I've looked through other similar questions, but nothing I try works, even after restarting my machine. I'm at a loss frankly.
Turns out the C# Extension on the current version is just buggy and not working right. Downloading an older version (1.21.16) and installing from VSIX seems to have somewhat fixed the previous issue. At the very least the error message has changed to something else.
For anyone also having this issue, I recommend trying what I did.

Predefined type 'System.String' is not defined or imported

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.

Visual Studio throws errors when attaching to Unity

All of a sudden when I try to attach to Unity 5.2 with Visual Studio 2015 I get a bunch of errors as seen in screenshot below. This is the second this has happened this week. Last time I had to create a new project and bring everything over to resolve the issue. Unity plays fine, no errors...but visual studio throws errors when I try to attach. It worked earlier this evening.
Few things to consider when project shows error while being fully functional in Unity3D Editor itself:
Can you build your project in Visual Studio even if errors are shown? If so, there is possiblity that these are just leftovers from Unity3D building your project - should disappear on first successful build from VS
If you can't build your project, have you tried to remove your Library folder from project's root folder? In many cases it will fix the problem but will end up in forcing Unity3D to rebuild some of the files it had previously in Library folder.
Have you added any new libraries (dll's) to project? Any chance they might be installed/added in a wrong way? If so, try readding them to project (if it's a classic dll) or readd plugin that you have troubles with.
I would leave version incompability as it would end up with errors in Unity3D console. Same with errors with solution per se.
When I changed target framework to Unity 3.5 .net full Base Class Libraries the build errors went away.
I found the solution posted by Nathan Koop here: Type or namespace name does not exist

Xamarin iOS error: Can not resolve reference

If I set up a Xamarin.Forms Solution in VS 2013 and try to run the iOS Version, it fails because of the following error:
Error 2 Can not resolve reference: /Users/Koray/Library/Caches/Xamarin/mtbs/builds/WalkiOS/aae389efbebffd5cd3625dcf99aad02c/C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0/Facades/System.Collections.Concurrent.dll Walk.iOS
The Xamarin Build Host for Visual Studio is set up and a few weeks ago it worked fine.
I can't find anything to fix the error.
The solution is to update Xamarin on both machines to the same version. It should work fine if you do this.
This can happen if you include a library that's not part of Xamarin.iOS. For example, when you Alt-Enter with ReSharper and it auto-adds a reference it thinks will work, when actually, there's no iOS equivalent of it. This happened to me when I had ReSharper add System.Web. The error looked like System.EnterpriseServices.Wrapper, but the actual error was a non-Mono/non-iOS library being referenced by my project. Unfortunately, the error message is effectively wrong. I hope that helps!
Ybrin's answer is also true. I came across this SO article looking for a different answer, and ended up figuring out this alternative answer.

Silverlight project fails to compile

I have a Silverlight 3 project in VS2008. Today, for whatever reason, I get an error when compiling.
Configuration system failed to initialize
It reports the error on Line 1, Column 1 for every .xaml file in the project.
I did a repair on VS2008, reinstalled all the Silverlight 3 bits (e.g. SDK, VS2008 tools and the Controls Toolkit), but the problem still persists.
Am I missing something simple?
If you have source code control for the project, please roll back to a previous change set and see if it works in VS still.
I suspect your project was corrupt for some reason.
Might be something that messed up your visual studio installation. If code is not a problem , then you can try system Restore.

Categories

Resources