The target "PostBuildEvent" does not exist in the project - visual-studio-2013

My application had a post build event in it but I was removing due to some required changes resulting in the following error.
The target "PostBuildEvent" does not exist in the project
So I went into my projects properties > Build Events to remove it. However once removed I would still get the error while executing the application. I then opened my .csproj to manually remove the post build event from there but that had the same result. Am I not removing the post build event properly or is there some kind of error occurring here? If there is an error what is a possible solution?
Update:
It doesn't seem to solely be a problem with any one application but all applications in Visual Studio, including new applications.

A reinstallation of Visual Studio has successfully solved the problem.

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.

Unable to load solution after upgrading to Xamarin Studio 6

I recently upgraded Xamarin Studio to the latest version, and now I am unable to load my solution!
Upon opening the solution, the below error is displayed:
I have looked into the logs, and I see the following:
System.InvalidOperationException: Already bound to project
Has anyone seen a similar error, or does anyone have a solution?
Thanks!
This error appear to be associated with the following Xamarin bug report:
https://bugzilla.xamarin.com/show_bug.cgi?id=41565
If you are able to try the following workaround, it should allow you to open the project.
Back up the solution
Open each .csproj file associated with an extension (such as WatchKit or Today)
Find the section "ProjectTypeGuids"
Remove the key "FEACFBD2-3405-455C-9665-78FE426C6842"
Save the file
Attempt to open solution
This should solve it for iOS
This also appears to impact Android projects which contain bindings. For example:
Given a test project (Test.csproj) with two ProjectTypesGUID: {EFBA0AD7-5A72-4C68-AF49-83D382785DCF} and {10368E6C-D01B-4462-8E8B-01FC667A7035} the project will fail to load. This is because the first ID corresponds to a regular Android project. The second one is for an Android Binding library project. The problem can be solved by removing the {EFBA0AD7-5A72-4C68-AF49-83D382785DCF} GUID from the .csproj
Fixing the issue for Android is similar to above. If the project contains both ProjectTypesGUID: {EFBA0AD7-5A72-4C68-AF49-83D382785DCF} and {10368E6C-D01B-4462-8E8B-01FC667A7035} then do the steps below
Back the solution up
Open the .csproj file
Find the section "ProjectTypeGuids"
Remove the key "EFBA0AD7-5A72-4C68-AF49-83D382785DCF"
Save the file
Attempt to open solution
Thanks!
Hope it helps :)
My xamarin project was made at windows, I copy to Mac. But Couldn't open same error. I solute with doing this. Open solution from windows visual studio. and right click solution then open xxmanager(i don't know english menu name, short cut maybe "o") and check build IOS. and copy to all solutions and project files to MAC. Then retry open solution. good luck
I have been experiencing this issue for hours. It started suddenly when Xamarin.iOS was giving issues due to lack of reference.
I tried the solutions here including removing the guid in Project Build but nothing worked.
To fix this, I realized that Visual Studio for Mac had downloaded an update which I installed and restarted immediately. I then noticed that Visual Studio Xamarin Form iOS component is missing at it states the presence of an update to 12.xxx.
I simply re-downloaded the iOS components (about 550Mb) and I am hoping everything would work fine.

Namespace not found within the same project according to intellisense, yet project builds

I have a simple ASP.Net MVC project which for some reason has issues with intellisense. It is constantly giving me errors that namespaces local to the project can not be found, even though they do exist and the project will build fine. Here's an example:
It is very frustrating as this results in me having no intellisense available whatsoever. Has any one encountered a problem like this before, and do they know of a solution?
The project itself is an MVC4 website running in VS2013 in W8 under Paralells on a Macbook Air, should that have any effect on the problem.
As stated, I have no error messages to provide as the project builds and runs successfully, but please let me know if more details are required.
I had the same issue. Try removing your project from the solution and then add it again. It worked for me. Looks like a solution file quirk.
UPDATE: this is not a permanent fix as closing and reopening visual studio brings back the issue.
UPDATE 2: while looking to fix another issue where I couldn't change the default namespace of a project (I would get a System.Runtime.InteropServices.ExternalException), I found out that it was related to Xamarin tools for Visual Studio. I proceeded to completely uninstall Xamarin. It fixed my namespace renaming issue as well as the weird type or namespace not found / intellisense issue.
I had this same issue, seems to be something with the solution file and building the project as I could replicate the problem by simply creating a new project building then restarting visual studio.
Anyway I get around it at the moment by deleting the solution file and opening the project using the project file.
For anyone reading this in 2020, a fix that I've found that has worked for me is:
cleaning the solution and unloading the projects that have dependencies such as a web API depending on a data project and an application project (right click on the project in solution explorer and find "Unload Project"),
then reloading and building each project in the order of dependence such that they build successfully (right click on the unloaded project in solution explorer and find "Reload Project").
so in my case my data project does not depend on any other project so I reloaded and built that first, then the application project which depends on the data project and finally the web API project which depended on both data and application.

VS2010 error : LNK1181 : cannot open input file xxxx.obj (only in debug mode)

I am using visual Studio 2010, trying to build a big solution having many VC++ projects converted from older Visual Studio builds.
The problem is, it gives me this LNK1181 for the 'root' project of the solution (the project on which all other projects are dependent) but only in DEBUG mode (win32). In release mode, it does not give me this error.
I noticed that this obj file is actually not created at all when in debug mode. Though the compiler doesn't give any error when it is building that cpp file.
What could be the problem? Is it related to those property manager sheets too somehow or something else?
The project is downloaded from our Source Control System directly, and works fine on other machines so there is something wrong on mine :(.
Click on solution.
goto Build menu and clean the solution and again build the solution hopefully this action sove your issue
You probably solved this a long time ago, but when I had this exact issue, removing the source files used to create the object from the project and then re-adding them as existing items fixed the issue. Of course, this doesn't change the fact that you're using project/solution files from your repo that other people are using without issue, which is odd.
For what it's worth, I had accidentally added *.obj files to the project, and so it was throwing this error.

Resources