Can't find Precompiled headers property in visual studio 2022 - visual-studio-2022

When I #include "StdAfx.h"; it return error code : E1696. So I try to check "Precompiled headers" in project Property. but does not exist. I even tried to reinstall VS2022 and install the SDK but the problem is still not solved.
I have searched for a similar question/answer but was unable to fine one.
This is my property capture file. "Precompiled headers" should exist under C/C++ property, but does not.

Related

Can Orchard 1.8.x be installed on a build server that does not have Visual Studio Installed?

I also asked this question on the Orchard forum but no joy there yet. So here it is again...
https://orchard.codeplex.com/discussions/569444 Please read for a few more details.
IF the .NET 4/4.5 SDK came with a developer command prompt (like previous SDKs) then I would not be asking this question.
But since Orchard is build with .NET 4.5 I am getting build errors using the old SDK. It seems that my only option is to install Visual Studio Express on the build server.
I am doing that as we speak so at this point the question is purely academic but I am still curious.
EDIT
STILL NO JOY. Even after installing VS 2013 Express Web the vcvarsall.bat that usually configure the build environment is still not present. So this is no longer a curiosity question. The Express edition also cannot create my build environment. Help.
Seth
Here is my answer...copied and pasted from the forum.
This is a late answer. Bottom line is that I did eventually get our build server to build orchard projects. I am not sure if this is a complete answer or not as I should have answered as soon as I had it done. But I pretty sure this will work.
One other thing to note...It is quite possible that not all of these steps are required. I tried a lot of different things and it might be in the end some of the steps were not needed. It might also reflect a problem on our build server...especially the fact that I had to manually add registry entries.
But here it is without details.
Install the .NET Framework SDK for Windows 7.1.
http://www.microsoft.com/en-us/download/details.aspx?id=8279
Install the .NET 4.5 Full
http://www.microsoft.com/en-us/download/details.aspx?id=30653
Install Visual Studio 2013 Express for Web
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Install the Visual Studio 2013 Build Tools
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Finally, even after that...it didn't work until I added the following registry keys. I would attach the .reg file but I don't see how.
Save the lines between the lines into a fixBuild.reg file. Then double click...
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7]
"FrameworkDir32"="C:\Windows\Microsoft.NET\Framework\"
"FrameworkDir64"="C:\Windows\Microsoft.NET\Framework64"
"11.0"="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\"
"FrameworkVer32"="v4.0.30319"
"FrameworkVer64"="v4.0.30319"
"12.0"="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\"
Finally, to actually do the build, I created a batch file that does the build.
Save the lines between the lines into a doBuild.cmd file. Be sure to place this in the root of the source download...then double click to build...
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
msbuild /t:FastBuild Orchard.proj
The first line gets your environment ready. The second build the project using the FastBuild target in the Orchard.proj file. You can read that file if you want to try other build targets.
******* EDIT
There is one thing I forgot to mention. And that is that one thing you have to do to get this to work is that you have to edit some CSPROJ files because the command line build fails with errors like these...
\Orchard\src\Orchard.Web\Modules\CKEditor\CKEditor.csproj(337,6): error : "None" element name for include "Placement.info" should be "Content".
\Orchard\src\Orchard.Web\Modules\Orchard.Tokens\Tests\Orchard.Tokens.Tests.csproj(82,6): error : "None" element name for include "app.config" sh
\Orchard\src\Orchard.Web\Modules\TinyMceDeluxe\TinyMceDeluxe.csproj(377,6): error : "None" element name for include "app.config" should be "Cont
\Orchard\src\Orchard.Web\Modules\Upgrade\Upgrade.csproj(156,6): error : "None" element name for include "app.config" should be "Content". [C:\Us
\Orchard\src\Orchard.Web\Themes\Themes.csproj(280,6): error : "None" element name for include "Upward\Views\Content-Story.Detail.cshtml" should
The fix is to do exactly what the error indicates. Open the csproj files and search/replace "
Also, some of the projects reference app.config files that do not exist in source. You also have to remove those references. I usually just delete the content node entirely or the group entirely.
Seth

Framework not found, when it is clearly there

I want to try out Scintilla (in Cocoa), but XCode does not cooperate. I included the Scintilla framework at scite337/scintilla/cocoa/ScintillaFramework/build/Release/Scintilla.framework by right-clicking the target in XCode and selecting Add Existing Frameworks.. and then Add Others.... This seemed to work, suddenly the compiler seemed to find the files because the files produced some parser errors (so it has to get compiled, right?). But after I solved these errors, I got a knew one:
Framework not found Scintilla
Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
I did verify if the Target Membership of the framework was set to required and it was. I tried to set the header search path to the path of the framework as well, but that gave the same error. I have no idea how to proceed from here.
XCode 3.2.6, Mac OS X 10.6.8

How do I include Scintilla in an XCode 3.2.5 project?

I downloaded Scintilla, built and ran ScintillaTest. That worked (almost) fine. Now, I want to include Scintilla in a new project, but can't seem to figure out how to. I tried ctrl-clicking my target and selecting Add Existing Framework..., then Add Other... and finally file located at scite337/scintilla/cocoa/ScintillaFramework/build/Release/Scintilla.framework (obviously I omitted the first part of the path).
After I did this I just added an #import statement in the AppDelegate of my further untouched new project. Upon hitting Cmd+R it says ScintillaView.h: no such file or directory...
I thought that if I added the framework to my only target it would pass the location of the header files to the compiler (and preprocessor). Obviously it doesn't, so I assume I'll have to add the paths of the header files (and maybe other files) to the Build Settings, but there are lots of Build Settings, so I don't have a clue where.
If you don't have access to XCode 3.2.x, please leave how you'd do it in a newer version. I've found a lot of information on other XCode matters for higher versions did that work well in XCode 3.2.5 too (with a little bit of searching for menu items and settings panels).
By looking at the ScintillaTest XCode project I discovered how it works: you have to import the XCode project called ScintillaFramework, which is the file named ScintillaFramework.xcodeproj (obviously). But that isn't enough, after that XCode still can't find the header files in the framework. I looked at the build settings in the ScintillaTest project and found 'Header Search Paths' set to ../../. Setting this failed in my project, it had to be one directory less back: ../. No I just need to get the compiler to accept the C++ constructs in the Scintilla framework.
Update:
Strangely, this stopped working. I do not understand it either. So I just right-clicked my target, from there: add existing framework...->add other...->[browse to ScintillaFramework/build/Release/Scintilla.framework]. This works partially, see my newest question.

Visual Studio 2013 C# Web Project builds but IDE reports The type or namespace name xxx could not be found error

When opening an MVC4 C# web project in Visual Studio 2013, the IDE reports the error "The type or namespace name '_' could not be found (are you missing a using directive or an assembly reference)", but the project builds and runs without any errors. Furthermore, intellisense does not include the project namespace.
The "missing" reference is to files within the same project.
for example; the web project namespace is "webproject.com", and references in a controller files to "webproject.com.models" is underlined in red with the error above.
I have checked the following:
All Solution projects are configured to use the same Target Framework(.Net 4)
web.config in the Views folder contains the namespace in the system.web.webPages.razor section
cleaned and rebuilt solution
deleted all bin and obj content
deleted .suo and .csproj.user files that were created by VS2010
The only way that I can get rid of these errors being reported in VS2013 is to unload then reload the project.
When opened in Visual Studio 2010 I do not get these problems.
I have the same issue.
ALthough the project compiles correctly, the code editor shows an error The type or namespace name '_' could not be found (are you missing a using directive or an assembly reference).
THere is one workaround. Just delete the *.SUO files and re-open the solution. THen for this only Session it works. Unfortunately after closing and reopening the solution the issue is back again. VS 2012 works fine.
Seems to be a bug in VS 2013....
My solution, when I encountered the problem with VS 2013 Express edition was to simply unload the offending project and reload. Opening the SUO or Project file and making changes had not affect.
Try to unload the project in VS2013, then right click the node and select edit "projectname.csproj". Check the individual references they might point to somewhere strange.
EDIT: the csproj file is an xml file and the references are located under Project -> ItemGroup -> Reference
I had the same issue.
It's a VS 2012 solution with different projects.
Search for all *.suo files and deleted them.
Rebuild and reopen Visual Studio.
There's a known issue with Web Application projects when bound to a TFS server that sounds like this issue. This occurs when the following TFS setting option is checked:
Options -> Source Control -> Environment -> Get everything when a solution or project is opened.
Disabling this option resolves the problem.
thanks,
Miguel Lacouture
[MSFT]
Same issue, on project reference.
I opened the referenced project file (*.csproj) with a text editor and did some cleanup:
1) reset these properties' values:
<PublishUrl>publish\</PublishUrl>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
2) removed dirty platform/configurations:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'x86|AnyCPU'">
...
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'x86|x86'">
...
Now I can compile without any issue.
Glad to share it with you! :))
Same issue. Opening the project's properties and making a change to the name (or any value) and then rebuilding seems to have resolved it.
I have just had this problem and none of the solutions here helped. I fixed mine by doing a repair of Visual Studio (An option when you select to uninstall the program). Hope this helps someone
I had same issue when I added a new class file ( e.g. MyClass.cs) and called it in some other C# code places. For some reason VS did not add that new class file to my working project folder (not seen in VS, but seen in Windows File Explorer). And, hence, the compile path for new class file is not included in the compile section of my project file (e.g. MyProject.csproj). So to solve this problem, First, right click on your working project > Add > Existing Item ... > Select your new class > OK.
Then, check the project file (*.csproj) and make sure a new element is inserted in the compile section such as:
Finally, rebuild your project and the problem should be solved.
Another reason for this issue is the project, I had long ago with VS, is my other project was set up with Client Profile as its target framework. So, to solve the issue: Right click your project in VS > Properties > Application tab > make sure Target Framework option is not Client Profile. You should change all projects in your solution to the same framework version AND all of them must not have Client Profile option.
Microsoft just released a new security update to be automatically applied to machines configured to use Microsoft Update.
Unfortunately, some ASP.NET MVC 3 and 4 VS projects can no longer build after the update is applied. These projects will fail with the following error:
"Could not locate the assembly "System.Web.Mvc,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"
My project also had the error "The type or namespace name 'System.Web.Mvc' could not be found (are you missing a using directive or an assembly reference)". Installing the latest version of Microsoft.AspNet.Mvc solved my problem. See the following article from Microsoft for more info:
http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx
Unloading and then reloading the project worked for me.

Compile, Build or Archive problems with Xcode 4 (and dependencies)

This question has evolved over the past several weeks to cover more general issues with xcode4 (and upgrading projects form older xcodes).
However many of the issues can be solved by following the same set of instructions.
If you have any of the following issues, try the methods in the accepted answer:
Xcode 4 fails to archive an App
Xcode 4 creates an unusable archive
Xcode 4 does not create an .ipa
Xcode 4 fails to compile due to preprocessor errors
Xcode 4 cannot find headers
Xcode 4's code complete is not working
Project dependancies won't compile
Adding a dependancy causes any of the above issues
Original Question
Title: "lexical or preprocessor issue file not found" in Xcode 4
I have a project in Xcode 4 that will build fine and run on the device and simulator but when trying to Archive it errors when looking for headers files associated with a static library:
In file included from /Volumes/Development/Path/LBProject/LBProject/LBProject-Prefix.pch:15:
In file included from /Volumes/Development/Path/LBProject/LBFDefines.h:23:
In file included from /Volumes/Development/Path/LBProject/Classes/LBProjectAppDelegate.h:11:
In file included from /Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDirectoryManager.h:10:
/Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDataModel.h:11:9: fatal error: 'Merchant.h' file not found [1]
#import "Merchant.h"
^
1 error generated.
Xcode gives the error
lexical or preprocessor issue file not found
Much Googling has show many people are having this issue but no solution. Anyone got a fix or even a clue.
Update: The user header search paths are set to ${BUILT_PRODUCTS_DIR} in all configurations. It builds fine using any configuration except when archiving.
Update 2: Merchant.h is a Core Data class that is auto-generated and therefore inside .xcdatamodeld package, however the headers are all copied to the public headers directory when the library is built.
NB: The steps below will solve 90% of your Xcode archive issues
however, from the comments it is suggested you try quitting Xcode
first. This may save you hours of setting tweaking.
Check the "user header paths" are correct (Add "" to paths for spaces, both in your project and dependencies)
Set "Always search user paths" to YES
Create a group call "Indexing headers" in your project and drag the headers to this group, DO NOT add to any targets when prompted. This includes any headers inside your .xcdatamodeld, you'll need to right-click and view package contents to find them.
For all dependencies set "Skip Install" build setting to "Yes"
Moving any "Public" headers in Build Phases to "Project"
Set the Build Setting "Installation Directory" on your Target to $(LOCAL_APPS_DIR)
Change the target build setting "scan all source files for includes" to YES. (link)
With newer versions of Xcode (> 4.2) you might want to read this question related to workspaces.
Manually delete the project.xcworkspace files form all referenced projects
I had the same problem in XCode 4: "Lexical or preprocessor issue MyFile.h not found". However, MyFile.m was not a static library, just a standard class. And MyFile.m and MyFile.h were included properly and indexed in the project.
So ... I quit XCode and the Simulator, then restarted them and the problem disappeared.
I found that the problem went away when I changed the target build setting "scan all source files for includes" from no to yes.
I was able to resolve this issue without any changes to any of the build settings by simply copying the .h files into the Project's directory in the finder. I did NOT add them to the project at all. Just having them in the project's filesystem directory seemed to be enough to allow Xcode's implicit linking to work properly. More details here.
I had a weird issue like this. Changing "Scan all resource files..." to Yes didn't help. I took a look at the Framework Search Paths and noticed that I had
$(inherited)
"$(SRCROOT)"
"$(SRCROOT)/my/correct/path"
It seemed right but was still failing. I then tried rearranging the order of 2 & 3 and all of a sudden it built fine. So not sure why that was the hickup, but wanted to add it to the list of things to try in case it helps someone else.
My solution was to change my
#import "HeaderFile.h"
to
#import <FrameworkName/HeaderFile.h>
and everything started working again.
What was unusual was that it had stopped working suddenly after building
a few times.
The problem resolved itself when I set
Build Settings->Project->Search Paths to Yes
I had the same — 2 targets in my project (Project and ProjectTest of GHUnit). When my scheme was set up to Project, the import of <GHUnitIOS/GHUnit.h> was problem of “lexical or preprocessor issue file not found”. But when I set as a scheme ProjectTest, everything was OK. So, I have added GHUnitIOS.framework in Project too.
Looks like your header search paths are incorrect not configured properly in your build settings for the active scheme. Verify them and update your question with the current setting.
I'm having similar issues on the simulator but not the device and my header search path fields are empty (Seems to be default). But changing Workspaces seems to have solved the issue. Maybe you could try creating a new Workspace, add your project to it and see if that helps. Now I'm investigating why.
I was getting this "file not found" error for one particular .h file in my project. I resolved the issue by removing that .h file from the project (selecting "Remove references") and re-adding it.
Adding on more variant: I had two instances of foo.m in the Compile Source build phase, which some how caused "Header not found" for foo.h.
Another chance:
In workspace project: watch in the Target for section Build Phases. As many manuals says you need to have a Copy Files Build Phase to copy all your headers to another place, as iOS Framework cannot contain header files to be shared (this is my case).
Choose for those Copy Files as Destination option "Products Directory". Or another directory of your like where the headers will reside.
That worked for me. Probably the build for Archive (or Release) directory is very different than expected in build for Debug .
Also check in your workspace settings your build directory.
XD
For me, this issue occurred after I added new files to the project; a blank .m and .h derived from NSObject. Here's how I resolved it:
Closed and restarted xCode
Deleted the two new files via XCode
Recompiled successfully
I then Re-added them afterward and it also worked.
Definitely a bug in xCode...