Can't build a xamarin project - xamarin

I am using xamarin with visual studio 2015, and when I create a new cross platform project and try to build it, this error shows up.
Severity Code Description Project File Line Suppression State
Error Reason: C:\Users\US\AppData\Local\Xamarin\zips\96659D653BDE0FAEDB818170891F2BB0.zip is not a valid zip file App2.Droid
How can I solve this issue?

It's just a bug with downloaded ressources, do this actions and comes back to us if your problem persist :
Navigate to C:\Users[user-name]\AppData\Local\Xamarin\zips
Delete 96659D653BDE0FAEDB818170891F2BB0.zip file from the folder.
Delete /.bin & /.obj folders from your project location.
Clean and Rebuild your project.

Related

Error publishing .NET MAUI project: the target "_GenerateAppxPackage" does not exist

I have a .NET MAUI project that was created with VS2022 Preview 2, and it builds without errors or warnings and works as expected in the debugger. Prior to updating Visual Studio to Version 17.4.0 Preview 4.0 I was able to publish the project as a sideloadable MSIX from within VS.
Since updating, I get the following error when I click Create in the Create App Packages wizard:
MSB4057 The target "_GenerateAppxPackage" does not exist in the project.
The error is listed against the MAUI project's .csproj file.
I've tried creating a separate new, default MAUI project in the new preview - this publishes ok and (as far as I can see) doesn't contain _GenerateAppxPackage anywhere within its files or project structure. So for now I'm assuming this isn't something new that was added with the preview.
I found some references to _GenerateAppxPackage on the web but they appear to refer to Azure integration. My project is a stand-alone data transformation app that doesn't even access the net.
I'm at a loss what to try next. I don't know what this target refers to, where it should "exist" within the project, or what it does. Can anyone help me understand the problem and/or point me to a solution?
Update: 2022-10-28:
I tried deleting the project structure and creating it from scratch with File -> New Project, then adding back only the .cs and .xaml files. Publishing the recreated project gives me the same error.
I also tried uninstalling the VS preview and re-downloading and installing it. Again, publishing the project gives me the same error.
I still have no idea what is causing this, or even where to start looking.
I faced with the same problem at Visual Studio 2022 17.4.0 (net6.0-windows10.0.19041.0).
The simplest solution for me was be using the command dotnet publish directly.
At root of project just write in terminal:
dotnet publish -f net6.0-windows10.0.19041.0 -c /p:RuntimeIdentifierOverride=win10-x64
I learned today that MAUI is now in the mainline Visual Studio 2022 edition, I've tried using that instead of the preview, and I can confirm that the problem goes away. I wish I'd known about this earlier...

Multiple "No resource found..." and "Error receiving parent for item" for fresh Xamarin project in VS 2017

I have created a new project for Xamarin in Visual Studio 2017 Community Edition 15.8.3. Then I added a few changes in the MainPage.xaml and cs and now I am getting these error on building the solution.
The errors refer to styles.xml which I didn't touch.
I was seeing this error earlier which required required restarting VS, rebooting computer, cleaning obj and bin directories, upgrading VS, etc.
I prefer to not do such things blindly.
Is there any systematic solution for this problem?
See if you have not change any of this in the MainPage.xaml
If not put here your content in that page just to see if anyone see the error.
This worked for me in a VS2017 cross-platform solution targeting Android 7.1:
Clean your project and rebuild it.
Change each XAML file properties:
Change the Build Action from "Embedded Resource" to "Compile" or "C# compiler"
Rebuild your project (it will produce errors)
Close VS2017 and delete the .VS folder and reopen solution
Change each XAML file properties:
Change the Build Action back to "Embedded Resource"
Rebuild and it was good for me.
On a separate project, the solution above did not resolve my errors and I also performed these additional steps with success:
Using this guide, I was able to determine that I was missing the following Nuget reference:
Xamarin.Android.Support.v7.AppCompat
After clean and build, close, delete .VS folder and reopen... I checked the log again and was able to determine that I was missing the following Nuget reference:
Xamarin.Android.Support.Design
Another clean and build and those problems went away... leaving me with remnant code issues that I was able to resolve.
After another clean and build... I received another error that I was missing the following Nuget reference:
Xamarin.Android.Support.v7.CardView
Another clean and build... no errors.

Error when generating ios publication file in visual studio 2017

I'm going to publish an application in the apple store, where I already created the certificate for mac, I already have an apple account. What I am not getting and generate the .ipa file to attach to the project by visual studio 2017 on windows. I checked some tutorials and they told me to put the project as ad-hoc but it generates the following error
Severity Code Description Project File Line Suppression State
Error The OutputPath property is not set for project 'App39.csproj'.
Please check to make sure that you have specified a valid combination of
Configuration and Platform for this project. Configuration='Ad-Hoc'
Platform='iPhoneSimulator'. This error may also appear if some other
project is trying to follow a project-to-project reference to this project, this
project has been unloaded or is not included in the solution, and the
referencing project does not build using the same or an equivalent
Configuration or Platform. App39

Roslyn project's didn't load after cloning the source code from github

I cloned the whole source code of roslyn from github.
When I open a solution, like Roslyn.sln or Samples.sln, many projects couldn't be loaded and I get an error displayed in the output window for every project that couldn't be loaded.
Error:
The imported project "BASEPATH.nuget\packages\Microsoft.VSSDK.BuildTools\14.2.25201\build\Microsoft.VsSDK.BuildTools.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. BASEPATH\Source\Repos\roslyn\build\Targets\Settings.targets
I use VS 2015 U2 enterprise edition.
I hope that there is somebody that can help to get the issue fixed.
You have to run the Restore.cmd script in the root folder before you can open in Visual Studio. You should read our instructions for building.
Simply copy a roslyn file out of one of your other projects and past it in your bin folder clean and rebuild and you will be all set

Error: The Target "GatherAllFilesToPublish" does not exist in the project, but is in v10.5 folder

I've been going around and around on this issue. I've got a ASP.NET MVC 3 Web application built in VS2010 SP1. When I attempt to Publish to the local file system, I get the error
The Target "GatherAllFilesToPublish" does not exist in the project.
and it fails. I've followed the answer described in Why do I get the error "The target GatherAllFilesToPublish does not exist"? but it doesn't resolve my problem.
I've installed the Azure SDK 1.8 for VS2010 (October 2012), trying to get my system back to working. With this install, I see the following files/folders in my MSBuild tree.
Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Targets, dated 1/18/2011.
This file does not mention the "GatherAllFilesToPublish"
After installing the Azure SDK, I've got another file/folder:
Microsoft\VisualStudio\v10.5\Web\Microsoft.Web.Publishing.Targets, dated 9/27/2012.
This file does contain the "GatherAllFilesToPublish" target.
Apparently my Publish function in VS2010 isn't using the v10.5 folder's targets. Does anyone have any suggestions to resolve this problem?
Thanks,
And the answer is...
At some point in the past, the project had been edited to include a local copy of the msbuild folder and I had forgotten about it. I used sysinternals' procmon to find the file access and it was only referencing msbuild under my project.
With that, i renamed the folder, edited the csproj file to remove the localized references for the MSBuildExtensionsPath32, and reloaded the project.
I was able to successfully publish my app.

Resources