Lots of my files in my Xcode project get "stuck" outside of my project and I'm unable to delete them. This happens occasionally when creating new files (maybe 50% of the time).
Here's a screenshot of what happens:
Any ideas?
Thanks.
Same problem, solved editing manually the project bundle:
quit xcode
right click on "Philly Shows.xcodeproj" and show its content
same operation on "project.xcworkspace"
open "contents.xcworkspacedata" with a text editor: you'll find references to your stuck groups and files, remove what you want to remove, basically your file should be something like this:
<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
<FileRef
location = "self:Philly Shows.xcodeproj">
</FileRef>
</Workspace>
Michele
Related
Whenever you refactor a TwinCAT project, it creates a .tmcRefac file. After building this file gets converted into a .tpr file. What are these files exactly and can I add them to my .gitignore file?
Short answer
The .tmcRefac can be ignored as also mentioned here and it was included in the official GitHub gitignore for TwinCAT. The .tpr file can't be ignored, because it contains important information about the rename history for the System Manager.
Long answer
The .tmcRefac file contains information about which variable got renamed to what:
<?xml version="1.0" encoding="utf-8"?>
<Refactors>
<Renames>
<RenamedSymbol>
<Type guid="904700f4-ab78-477a-973a-562c3c32f400">MAIN</Type>
<From>number1</From>
<To>number2</To>
</RenamedSymbol>
</Renames>
</Refactors>
After building the project with TwinCAT 4024.12 this files seems to get removed. However, if you have a stand alone plc project, it gets converted into a .tpr file. This .tpr file again contains information about the refactored variable:
<TcModuleRefactorInfos RefactorCnt="1">
<TcModuleRefactorInfo RefactorCnt="1" DateTime="2021-11-11T10:46:12">
<Renames>
<RenameSymbol>
<From>MAIN.number1</From>
<To>MAIN.number2</To>
</RenameSymbol>
</Renames>
</TcModuleRefactorInfo>
</TcModuleRefactorInfos>
Beckhoff support says about this file:
The .tpr file is required to save the rename history of I/O variables in a stand-alone PLC project, since the PLC project and the System Manager are not in the same project. I don't think you should ignore the file as it is relevant to the rename history.
Bug
If you're running TwinCAT 4024.10-4024.12 there can be a bug which crashes Visual Studio/XAE when a .tpr file is present. Solution is to upgrade to > 4024.15.
While trying to compile a Xamarin Forms (2.3.4.247) project on Visual Studio for Mac Community (7.0.1 [build 24]) I keep getting the two following errors after coding some time, any clue on what caused it and how to fix it?
/Users/PathToProjectRoot/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(3,3): Error MSB4061: The "XamlCTask" task could not be instantiated from "/Users/PathToProjectRoot/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.Build.Tasks.dll". Could not load file or assembly 'Xamarin.Forms.Build.Tasks' or one of its dependencies (MSB4061) (ProjectName)
/Users/PathToProjectRoot/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(3,3): Error MSB4060: The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. (MSB4060) (ProjectName)
What I have tried
Updated all packages and and SDKs.
Cleaned/Rebuild solution.
Removed all packages, closed VS, reopened and got all packages restored.
Removed all the bin and obj folders to try a rebuild.
Check the 3 .csproj for any outdated imports previous to 2.3.4.247.
Create a new solution.
What has worked
Creating a new clean solution using Xamarin Forms works however this causes all the packages to be from an old version. I've already done this twice but I'd like to be able to stop doing this as it takes a crazy amount of time to transfer all files from the broken project to the new one.
What hasn't worked
Besides all the things I've tried, it may be useful to mention that creating a new project after having cleared all the previous ones within the same solution doesn't fix the issue.
This makes me think that it is a solution-level error rather than a project-level error.
What packages are installed
Xamarin.Android.Support.Animated.Vector.Drawable.25.3.1
Xamarin.Android.Support.Annotations.25.3.1
Xamarin.Android.Support.Compat.25.3.1
Xamarin.Android.Support.Core.UI.25.3.1
Xamarin.Android.Support.Core.Utils.25.3.1
Xamarin.Android.Support.Design.25.3.1
Xamarin.Android.Support.Fragment.25.3.1
Xamarin.Android.Support.Media.Compat.25.3.1
Xamarin.Android.Support.Transition.25.3.1
Xamarin.Android.Support.Vector.Drawable.25.3.1
Xamarin.Android.Support.v4.25.3.1
Xamarin.Android.Support.v7.AppCompat.25.3.1
Xamarin.Android.Support.v7.CardView.25.3.1
Xamarin.Android.Support.v7.MediaRouter.25.3.1
Xamarin.Android.Support.v7.Palette.25.3.1
Xamarin.Android.Support.v7.RecyclerView.25.3.1
Xamarin.Build.Download.0.4.5
Xamarin.Forms.2.3.4.247
What Android platforms are installed
android-23
android-25
What file causes the errors
Error is caused by the file Xamarin.Forms.targets containing the following lines:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlGTask" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/>
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/>
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlCTask" AssemblyFile="Xamarin.Forms.Build.Tasks.dll"/>
<!-- Some more lines here ... -->
<Target Name="XamlC">
<!-- /!\ Error flagged at next line's "<" -->
<XamlCTask
Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
ReferencePath = "#(ReferencePath)"
Verbosity = "2"
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
DebugType = "$(DebugType)"/>
</Target>
</Project>
Latest updates
[June 16]
After trying to create a new solution several times, I'm now unable to create one that's able to build. Whatever version my packages are on, I keep getting those two errors.
See the Build output here.
This issue was caused by the # character within the project's path. Removing it resolved the issue.
Wired ... But closing visual studio and reopen solved the problem in my case
I had the same issue, it was caused by C:\User\name\.nuget folder being a symbolic link (created with MKLINK), which pointed to a directory on a bigger drive. When I set NUGET_PACKAGE environment variable to the actual location of the package directory, the issue is solved.
I was facing a similar issue like yours. I updated many dependencies and removed a few.
I'm using this version of VS
I tried all the answers and didn't work.
I followed the "Just In Case" approach (mentioned in this answer thread previously.) of killing the VS instance and reopening it. Then when I executed the project all errors vanished.
In my case, I didnt have # in the path and I tried clean and rebuild,deleting obj,bin,packages folders, closed and opened many times etc but didnt work.
My nuget packages folder is referenced at this path 'C:/Users/xyz/.nuget/packages/'
I tried to change the path of this nuget packages folder using a nuget.config file and placed it in the solution folder as specified in the below link and it worked.
Is it possible to change the location of packages for NuGet?
For me this piece of code worked among all the answers in the above link.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value="C:\Projects\MyProj\.nuget\packages" />
<add key="repositoryPath" value="C:\Projects\MyProj\.nuget\packages" />
</config>
</configuration>
I've got multiple Visual Studio projects and solutions that have a .jmconfig file in the root directory for the project or the solution. I only noticed that the file shows up when checking my project into source control and it tells me that the .jmconfig is new.
Here is a sample:
<?xml version="1.0" encoding="utf-8"?><Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><DontShowAgainInSolution>false</DontShowAgainInSolution></Configuration>
This is JustMock trying to save some settings so that you don't get reminded to upgrade all the time.
I installed the VS2010 web publishing updates yesterday, and now whenever I try to load a WiX setup project (all showing as unloaded in solution explorer) I'm getting the error:
The imported project "PROJECTNAME.wpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.5\Web\Microsoft.Web.Publishing.targets
Where PROJECTNAME is the path to my setup wixproj file, without the .wixproj extension. I've checked through the project file and there is no reference to a wpp.targets file anywhere. I decided to try and create a blank targets file in that location and so added one with just this in it:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
But got exactly the same error - a not found exception despite the file being there!
I then dug into the Microsoft.Web.Publishing.targets file and had a look for any ".wpp.targets" text, which gave me this:
<PropertyGroup Condition="'$(EnableWebPublishProfileFile)'=='true' And
'$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile)) ">
<WebPublishProfileCustomizeTargetFile Condition="'$(WebPublishProfileCustomizeTargetFile)'==''">
$([System.IO.Path]::ChangeExtension($(WebPublishProfileFile), '.wpp.targets'))
</WebPublishProfileCustomizeTargetFile>
...
So that looks to be setting up a filename of PROJECTNAME.wpp.targets, but only when the EnableWebPublishProfileFile property is set to true. I added this to my wixproj file's main propertygroup:
<EnableWebPublishProfileFile>False</EnableWebPublishProfileFile>
Again though, it made no difference at all to the error. I'm running out of ideas here now!
Further update
I've been trying to repo this on a blank project (so far without success), and the messing about has narrowed the error down to this line (186) in the Microsoft.Web.Publishing.targets file:
<Import Project="$(WebPublishPipelineCustomizeTargetFile)"
Condition="'$(WebPublishPipelineCustomizeTargetFile)' != ''"/>
This is set at the top of the file:
<WebPublishPipelineCustomizeTargetFile
Condition="'$(WebPublishPipelineCustomizeTargetFile)'==''">
$(WebPublishPipelineProjectDirectory)\*.wpp.targets
</WebPublishPipelineCustomizeTargetFile>
I'm not sure how this is getting changed to PROJECTNAME.wpp.targets though?
I tried overriding this in my project file, but once again, it makes no difference at all.
Next I added an Exists() condition to the line in the targets file, now some projects are working and others are not, instead failing (on build) with the error:
The "DisableEscapeMSBuildVariable" parameter is not supported by the "ImportParametersFile" task. Verify the parameter exists on the task, and it is a settable public instance property.
My journey continues...
I experienced the same issue when trying to open a standard web project.
The proj file was referencing the following import for v10.0 targets but throwing the import error in the question which referred to v10.5 targets.
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" />
The same was true when I referenced a hard coded path - I still got v10.5 error
My solution was to simply back up and remove that version located at:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\10.5
I'm really not sure what other programs and projects need this version or why import paths were not followed but it go this project open for me seeming falling back to the correct version.
I have an Xcode 4 project with 2 targets, one for iPhone and one for iPad. If I click on the iPad target and try to go to Build Settings Xcode 4 crashes:
Encountered multiple assertions. First assertion was: ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-269/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/FileTypes/../PBXFileType.m:594
Details: filename should be a non-empty string, but it is nil
Obviously the pbxproj file has a bad reference in there somewhere -- likely caused by the many manual merges I've been forced to do by git. Is there some way to clean up the pbxproj file so it works correctly again or to tell which line is causing the problem?? I'd really really prefer not to have to recreate the project from scratch.
I tried gorbster's method with no success (though it has solved similar problems for me in the past).
I went into my project.pbxproj file (inside the .xcodeproj package for the project) and found two lines that looked a little suspicious, both of the form:
53A45F8F138FE6F40077017F /* (null) in Resources */ = {isa = PBXBuildFile; };
I deleted the lines, and voilĂ : I can access my build settings for this target again.
No idea how they got in there in the first place. I would guess something to do with a faulty merge under SVN.
Ran into the same issue this morning after pulling a colleague's merge.
I was able to fix this with the following:
Close Xcode
Open the .xcodeproj package in Finder
Delete the project.xcworkspace file/package
Open the xcuserdata folder and delete your user-specific .xcuserdatad folder.
Re-Open Xcode and project
I lost some minor user preferences (file and tab history, etc), but can now click all (9) of my targets without issue. Turns out my colleague was on an earlier version of Xcode, but I'm not sure if this contributed to the IDE crashing.
Ben Mosher found the solution.
And yes it is due to SVN merge problem.
As we working in team with SVN the error occur often so I wrote a bash script:
#!/bin/bash
sed "/(null) in/d" project.pbxproj > tmp_project.pbxproj
mv tmp_project.pbxproj project.pbxproj
Try the following steps while your Xcode is closed.
Go to your {YOUR_PROJECT}.xcodeproj file in finder.
Right click on the {YOUR_PROJECT}.xcodeproj file.
Choose Show Package Contents ... this will open the contents in another Finder screen.
Open file project.pbxproj and search for all lines having string "(null) in"
Delete all lines having (null) in ... no worries.... delete confidently.
Save your file.
Now open your project using Xcode and try to open the Build Settings tab... hopefully your problem will be solved.
Thanks,
Mohamed.
Right click your .xcodeproj file and "Show Package Contents".
Then open project.pbxproj file with TextEdit and duplicate.
Save duplicate file anywhere with same name and extension. (project.pbxproj)
And replace with the old file.
In case you also tried the remove (null) reference lines and deleting the user-specific .xcuserdatad folder, and those did not work, here is a potential solution. FYI... This was experienced on Xcode 7.3.1 .
Here is the scenario I faced:
I experienced this issue that was triggered by having "twin" branches in a git repo... (i.e. one branch BRANCH_A is a development branch with some features not due for release, and another that had the same commits except for the new features, call it BRANCH_B).
The development work flow is as follows: start with BRANCH_B, create a commit branch CHANGE_C, make changes and commit, then checkout BRANCH_A, create a commit branch, then cherry-pick changes from CHANGE_C. BRANCH_A is tracking BRANCH_B in this way, with its additional feature files.
In my case, (for some reason during rebasing on co-worker changes from the remote that BRANCH_B tracks, the project file for BRANCH_B got corrupted.
In this case, the solution is to save a copy of the project file for BRANCH_A (which is good and compiles), then checkout BRANCH_B, and replace its project file with the copy.
Initially, it will not compile, until all references to the feature files (from BRANCH_A) are removed from Target's Build Phases > Compile Sources.
Works great.