Can I disable precompilation for a particular folder? - templates

I have some .cshtml templates I'm using to render to PDFs.
When I deploy to production they get precompiled and contain the text "This is a marker file generated by the precompilation tool, and should not be deleted!" Is there a way to tell ASP.NET not to precompile a particular subfolder? I thought maybe I could do this in web.config, but I can't find it.

I know this is 2 years old but recently I stumbled on the same problem, but since I needed the view for both MVC and e-mail I couldn't simply change the extension of the file.
Searching for solutions I found this documentation on aspnet_compiler and the -u options, that stands for Updatable, which keeps the original file intact after compilation.
In order to achieve the desired behavior I configured my publish profile as follow:
On Settings tab of Publish dialog expand the File Publish Options and check Precompile during publishing.
Click the Configure link after the checkbox and check Allow precompiled site to be updatable
Caution
Before jumping in this solution you should read carefully about the implications of this option. In the link I provided there is a Precompilation Decision Matrix to help on your decision.

I couldn't stop the views from being compiled, even by setting the build action to 'none' and turning on copy to output directory.
I ended up changing the extensions of my files to .prod, setting the content type as 'content', and setting them to open with the HTML editor in Visual Studio to get everything working the way I wanted.

Related

Vscode c++ code formatting won’t add space after open parenthesis

I am using visual studio code with c++. When I format my code (Ctrl-k,Ctrl-f) it removes the spaces I place after/before open/close parentheses. I have the setting to add these spaces enabled and also see them in the settings.json file. I’m not using a prettier extension. I use only a c++ light theme extension, cmake and cmake tools extensions.
The formatting is working otherwise, perhaps, only because I am fine with the default formatting except the extra spaces. Trivial but it’s driving me crazy.
Does anyone have an idea how to make the formatted pay attention to the settings?
Thanks,
Eddie
The best way I know to solve this problem is to install the C/C++ extension by Microsoft (C/C++ IntelliSense).
After installing it, go to extension settings and choose between User and Workspace settings. What you need to adjust are these two lines:
C_Cpp: Clang_format_fallback Style and
C_Cpp: Clang_format_style
Based on your personal preferences, choose the CPP style out of those listed in extension settings (Google, LLVM, Chromium, Mozilla, etc.)
In addition, you might want to use extended settings as described here, e.g. "{BasedOnStyle: Google, ColumnLimit: 0}"
Moreover, there is another convenient way how you can adjust your formatting settings in VS Code's settings file:
Go to your VS Code and open your workspace / any file
If you are on Mac, press "cmd + Shift + P" and a console will appear
Remove the caret ">" and type "settings"; you'll see two files: 1) settings.json in the .vscode folder and 2) settings.json in your system user folder. The first one is responsible for your workspace settings and the second one – for your user-wide settings.
Each and every setting you change in your C/C++ extension is reflected in these files. Try to experiment with them. Changing the workspace file settings is useful when you work in a team and need to have the same formatting settings shared across all team members.
Take a look at these screenshots for reference:
Good luck!!

How to use VS Code C/C++ configurations properly?

I am new to VS Code and, coming from VS, I'm struggling to understand how to set up different configurations using the Microsoft C/C++ extension. I followed the documentation, but it seems to me that the content in c_cpp_properties.json is only affecting Intellisense and has no correlation to the actual build, which is set up in tasks.json. The configurations I enter are showing up and selectable at the lower right of the editor window: Intellisense reflects this by apparent knowledge about include folders, etc. However, when I build or run, they don't have any effect, I get errors such as "No such file or directory" for included files. As far as I see it, this is not mentioned in the documentation at all.
How can I make use of the actual selected configuration for the build system?

How to generate .ipa from .app file in Xcode 9

I am using Xcode 9. I did archive the build and got in to archive window/organiser window. From there we usually export the build. But due to some reason I cant do that.
On the prior version of Xcode, we can get into package contents and generate .ipa from .app with the help of iTunes. But now they have removed that option. Can someone help me to generate .ipa from the .app file that we have generated?
The earlier way of dragging and dropping the app file to iTunes does not work anymore.
So we can use the organizer to create .ipa file in Xcode 9.
Create an archive of your project.
Then in organizer window select the archive and click on the export option.
Then select a method of distribution in next dialog box(I had
selected development distribution).
Then the archive is prepared and development distribution options are presented. You can select any App thinning option or leave it as none and select or deselect other options and then click Next.
Then you will be prompted to select the appropriate development certificate and mobile provisioning profiles. After selecting, click Next.
Then archive will be built for distribution and you will be asked to review your applications .ipa content.
If everything is alright, click on the Export option in the dialog box.
You will be presented with another dialog box for entering the export name and location.
Enter the export folder name and select a location and then click on Export. Your .ipa file will be exported to the location which you had selected.
For more information/help regarding this way of .ipa file generation, refer to https://wiki.genexus.com/commwiki/servlet/wiki?34616,HowTo%3A+Create+an+.ipa+file+from+XCode
Also this link should help -- How to create .ipa file using Xcode?
From the other answer I see you can generate the .ipa file fine and the issue seems to be that you can't drag and drop your file anywhere as Apple have removed the applications page from iTunes.
From doing a little of my own research I think the current best solution (although I have not tried this myself yet) is to download iTunes 12.6.3 where the applications option is still available.
Please see the following link for a guide on how to do this: https://www.macworld.com/article/3230135/software-entertainment/how-to-install-itunes-1263-and-replace-itunes-127.html
The only downside I can see is that it is no longer in support as Apple only provide support for the latest version of iTunes (12.7 at the time of writing). However I guess that's exactly what stack overflow is for!
Let me know how it goes!
EDIT:
Just to let you know I've now downloaded iTunes 12.6.3 myself and I have my apps option back! Hopefully that helps you and you can then just follow the process you used to carry out. I have also found another post similar to yours with alternative solutions too:
With Apps option removed from latest iTunes 12.7.... , how to install adhoc IPA?

Compressing js and css using Team Foundation Server 2010

I have been banging my head on a brick wall that seems to be easily worked around for everyone except me.
I want to setup css and js compression using a standard build on Team Foundation Server 2010. Below is what I've tried so far and failed. I am looking for a magic helping hand to guide me into setting this up the way professionals (SO is full of em) believe it should.
http://yuicompressor.codeplex.com/releases/view/46679 (dowload demo using post-build events)
This method looked promising as it did exactly as promised when you build your project in Visual Studio.
My msbuild Post-build command:
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)..\Content\StylesSheetFinal.css"
/p:JavaScriptOutputFile="$(TargetDir)..\Scripts\JavaScriptFinal.js"
However when the build is run by TFS I get a lot of errors like these:
D:\Builds\3\CKB 2010_Build_CP\Sources\CKB
2010\My.Name.Space\MSBuild\MSBuildSettings.xml (61): Failed
to save the compressed text into the output file [D:\Builds\3\CKB
2010_Build_CP\Binaries..\Content\StylesSheetFinal.css]. Please check
the path/file name and make sure the file isn't magically locked,
read-only, etc..
So clearly the problem is the syntax in the Post-build command that is wrong. But I can't figure out how to make it work for both local and TSF builds.
Update 2011-08-17
As noted by Edward Thompson, I've tried adding a backslash to the path:
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)\..\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)\..\Scripts\scripts.min.js"
And the result is this:
Failed to save the compressed text into the output file
[D:\Builds\3\CKB 2010_Build_CP\Binaries\\..\Content\styles.min.css].
Please check the path/file name and make sure the file isn't magically
locked, read-only, etc..
The problem is the difference in values with which TFS and Visual Studio run the msbuild command.
These are the steps I have taken to get proper YuiCompressor integration with Visual Studio 2010 and Team Foundation Server 2010.
In your desired project add a folder named 'MSBuild'
In this folder you should extract the files you download from the YuiCompressor project on CodePlex
Set the properties of these files like this:
Now open the MSBuildSettings.xml file and edit it according to the scripts and css files you want to have compressed. I have uploaded mine on pastebin since pasting it here caused problems with the editor.
Add the following postbuild event to your project. Note that the paths can differ for your environment.
IF "$(BuildingInsideVisualStudio)"=="" $(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)_PublishedWebsites\$(ProjectName)\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)_PublishedWebsites\$(ProjectName)\Scripts\scripts.min.js"
IF "$(BuildingInsideVisualStudio)"=="true"
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)..\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)..\Scripts\scripts.min.js"
Build the project and see if the files where created as expected.
Perform a check-in and watch the tfs build create the compressed files for you.
For debugging the tfs build, you'll find the logs in the msbuild log which is linked inside the normal tfsbuild log.
I hope this helps someone out there. I couldn't find a decent guide anywhere so now there is one here! If you have other suggestions, feel free to add them or post them in the comments.
One thing that sticks out at me is that you're using $(TargetDir)..\ - which expands to \Binaries..\. I suspect that you don't have a Binaries.. directory, and that this is supposed to be \$(TargetDir)\..\. (Ie, the parent of the Binaries directory.)

Clean Eclipse Index, it is out of sync with code

I'm using Eclipse with C++ code via linked resources on Linux. The code analysis index seems to be corrupted (Goto definition lands the cursor close to, but not on, the definition) Refreshing resources doesn't fix it, neither does restarting Eclipse.
Is there a way to flush the index and rebuild it?
Right-click on your project, go under the Index submenu, and choose either "Rebuild," "Update with modified files," or "Freshen all files."
I don't know the difference between those three options, but one of "Update with modified files" or "Freshen all files" usually fixes it for me.
Also, I'm sure you've already done this, but make sure that you're running the latest version of the Eclipse CDT. Current versions seem to have much more reliable indexing than previous versions.
From http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg10390.html, the differences between "Rebuild," "Update with modified files," or "Freshen all files":
Rebuild: Works for entire projects, only. Clears the index and indexes
the files from scratch. When cancelled it leaves you with an empty or
partial index.
Update with Modified Files: Works on a resource
selection. Checks on individual files whether the timestamp or the
scanner-config has been changed and updates the index for the changed
files.
Freshen All Files: Works on a resource selection. Updates the
selected files in the index. The index is not cleared, it is safe to
cancel the operation.
Go to your project properties -> C++ general -> Indexer.
Do this with 'project specific settings',
(or on 'Configure Workspace Settings...').
Deselect 'Enable Indexer' hit Apply.
Select 'Enable Indexer' hit Apply.
This should completely wipe out and rebuild the index.
Neither of the above worked for me (Eclipse Indigo), index still broken and refusing to rebuild properly. Until applied this one:
http://slsam2.blogspot.com/2012/02/eclipse-cdt-index-not-working.html
The crucial bit of the linked post is this:
Eclipse no longer treats your project as a C++ project. Choose menu File/New/Convert to a C/C++ project. It takes a while to index the source code.
I still wonder how Eclipse can uncontrollably shoot itself in the foot like that. I suspect that installing additional packages can trigger it. Perhaps JavaScript support in my case.
delete only the .pdom file under .metadata.plugins\org.eclipse.cdt.core helps, I got the indexer screwed after upgrading Neon.2 to Neon.3 and this seems to solve the problem.
(this comment already exists above but am not allowed to confirm it up there).
I found that I had the global indexer set to 'Use the build configuration specified in the project's indexer settings',
and the project's indexer set to NOT use project specific indexer settings.
Regardless, it was using the same fixed configuration for the indexer regardless of which configuration I had selected.
The fix:
Window-Preferences, C/C++, Indexer. Select "Use active build configuration" in section "Build configuration for the indexer".
Happy days.
Did you try adding -clean to the command line for the eclipse executable?
Eclipse no longer treats your project as a C++ project. Choose menu File/New/Convert to a C/C++ project. It takes a while to index the source code. worked for me
I started with trying Josh Kelleys and mmmmms answers without any luck, but I finally fixed it by checking my include paths.
One way to see them are in the Project Explorer, expand project and there should be an entry "Includes". Inside that, check for a small yellow warning triangle on each include path. If that triangle is present eclipse most likely doesn't recognize the path.
The include paths are edited through right-clicking on "Your project" in the Project explorer, then choose "Properties" --> C/C++ General --> Paths and Symbols --> Includes.
I see three language options, Assembly, Gnu C, Gnu C++. Choose the correct one before starting to add paths (likely Gnu C++). After adding all the paths, -->Apply --> Ok and rebuild index if you're asked to.
My erroneous workspace paths looked like MyProject/MyProject/folder when it was supposed to be MyProject/folder.
For me the "Problems"-view is always slow to update, even after rebuilding index. To be sure that the error is still there, double-click the problems entry so that eclipse opens/reloads the file in question. This often seems necessary for me to update the "Problems" view.
I don't really know if it was eclipse or my scm that messed it up. Anyway, hope it helps someone!
I use Luna and builds with an external makefile.