We use Microsoft Ajax (ajaxmin.tasks) approach which described in this one (http://stackoverflow.com/questions/5043504/using-microsoft-ajax-minifier-with-visual-studio-2010-1-click-publish) to minify the css/js file when each build, it works great.
But the minified file changes every time when rebuild, even the original file has never changed. This cause the publish process (or by FTP) transfer all minified css/js files each time.
My question is:
how to stop Visual Studio publishing the same file (maybe timestamp is different)?
Or how to stop Microsoft Ajax Minifier minify a file has already been minified?
Thanks.
The AjaxMin build task should be looking at file times and not minifying if the output is newer than the input. I'll enter a change request in the AjaxMin website, http://ajaxmin.codeplex.com.
Related
We are experiencing bad slowdowns in Visual Studio 2019 that appears partly due to a large folder of content (~12,000 files) that we have in our wwwroot folder. This content rarely changes, but it ends up getting searched when we do "Find in files...", etc. which we don't need, and ends up slowing down normal operations such as adding/renaming classes.
Is there any way to keep the content in source control, exclude it from Visual Studio, yet still have it get deployed when we publish?
I haven't been able to figure out if this is possibly editing the csproj file using the settings such as DefaultItemExcludes, or various options on the ItemGroup element.
Here is what we have done to (hopefully) resolve this issue for us:
Added the following line to our WebApp.csproj file within the PropertyGroup:
<ProjectGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\hugecontentfolder\**</DefaultItemExcludes>
</ProjectGroup>
The huge content folder stays where it is in source control, this simplifies things as we need those files there to be served locally for development
We updated our Azure DevOps pipelines with new tasks to copy the contents of that folder from source control into the build artifact staging directory
Updated the Dotnet Publish Azure Devops task to no longer zip it's output
Another new Azure DevOps task to Archive the build artifact staging directory (which now has the non-zipped dotnet publish output, as well as the huge content folder output in the correct location) into a zip file for publishing.
We have come across a problem where our .csproj file does not save until we do Save All. This is causing issues as it is often not pulled into git and send up having missing file errors when trying to build. I know that in VS 2013 2012+, the .csproj file is supposed to save whenever a build occurs. Publishing causes a build to take place so there is no reason for it not to save.
When developing SharePoint hosted app in Visual Studio, I cannot find a way, how to tell Visual Studio in debug mode to upload typescript and their generated js files to SharePoint after changing their content.
Normally, if I change the code in javascript file (while debugging in Visual Studio), JS file is automatically uploaded to SharePoint - this is correct and expected scenario.
However, how to make it work with Typescript files? After saving Typescript file, JS file is automatically re-generated , but this JS file and TS file are not uploaded to the server.
It can be partially solved by manually changing content in JS file to trigger automatic upload to SharePoint, however I couldn't find a way to upload TS file.
Is there a way, how to tell Visual Studio to upload Typescript files (and auto-generated js files) to SharePoint in debug mode?
Please note, that I am describing only a case in debug mode (typescript files are uploaded to sharepoint via standard packaging mechanism just fine).
Thank you.
In our case we didn't want fully automatic so we used oofice pnp provisionning with a powershell script.
If you want a fully automated flow I guess gulp watch + a gulp task to do that like gulp sp-sync
I don't want to do a build all typescript files on build/run. I just want to build them on save. However, the generated .js files are not checked in to TFS, which means another developer would have to open and save new/modified .ts files. Is there a way to include the generated .js files in TFS?
I am using VS 2010 so I do not have the Web Essentials 2012 extension.
The best way I've used was to create a blank .js file with the expected output name in your solution and check that into TFS.
In my web project I often have a number of files in my app_data folder. These files can vary from time to time (example translation files get a new language, lucene index gets updated and gets a new file name etc).
Visual studio only adds files to the deployment process if the files are seperately added to the project. So if a file has been added on disk, but not in the project, this file will not be copied to the server...
Is there a way to make VS add all files in a folder to the deployment process without me having to update it manually?
You can use a post build event to copy the contents of a folder to the build target.
This should get you started:
http://visualstudiohacks.com/general/customize-your-project-build-process/
Wow I just saw this was asked in 2009...I hope you figured this out already :)