Webdeploy skip rule includes .css files as well as .cs - msdeploy

I am trying to use webdeploy in my build system. I would like it to be able to pull content files from my source code file but skip the code files. I am using a skip rule:
"-skip:objectName=filePath,absolutePath=.*.cs$"
but it skips .css files as well as .cs files.
What am I doing wrong?

Are you sure your CSS files are in your package to begin with? Remember that, by default, Visual Studio only packages/deploys files that are:
Included in the *proj file
Marked with a Build Action of Content
You can change this behavior in Project Properties -> Package/Publish Web -> Items to deploy

The regex is incorrect. This worked for me.
.*\.cs$

Related

How to change Asp.net .cs file path

I am newbie with asp.net. I'm using Visual Studio 2022 to write my codes. How can I change the ".cs" file location ? because I need to send my application to someone else. The issue starts when I put ".cs" file in a 1 folder. When ".cs" file on my desktop the application works.
I find a solution for this problem.
Do this following steps :
1)Go to the file which appears as Miscellaneous Files inside Solution Explorer.
2)Right-Click file and select Exclude from project.
3)Right-Click your project/folder where the file was and click add Existing Item, and add the file you just removed back into your project

Where to put the live-search-docs config file in all in one alfresco project?

I have been going through some blog posts that tell how to customize the live search . What is not clear to me is where should I place the live-search-docs.get.config.xml file in my all-in-one-share project so that it is bootstrapped and deployed in the correct location.
Please can some one advise where the file should be placed in my all-in-one alfresco project?
From the link below
https://www.bluefishgroup.com/insights/ecm/adding-metadata-fields-to-simple-search-and-live-search-with-alfresco-5/
they suggest the search query customization file to be placed under
These files can now be modified to add additional metadata fields as
needed. Once the files have been updated, they should be deployed to
the ‘extensions’ directory so that they will override the out of the
box configuration. If you are deploying your code as a custom AMP
file, the files should target the following directory:
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search
if my file needs to end up in the above path in my WAR, where exactly should I place the search file in my all-in-one alfresco project so that its deployed to the above folder? I would like this to be bootstrapped with my all in one project. I tried putting the file under src/main/resources/alfresco/site-webscripts with the remaining path for the file but that did not work.
Thanks
The easiest way is to create a copy of that file in:
my-all-in-one-project-platform-jar/src/main/resources/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/
where, of course, my-all-in-one-project-platform-jar must be substituted with the name that you have specified when the project was created with the all-in-one archetype.
The file in the extension subpath will override the corresponding OOTB files.
See Web scripts

How do I get msbuild to put my web application in the root output folder and not in _PublishedWebsites

How do I get msbuild to just put my web application in the output path, and not in the hacky special _PublishedWebsites folder? I don't want to modify global config files, but I am willing to edit my .csproj file.
You can override WebProjectOutputDir to go to whatever directory you like, however the binaries will still be in this folder as well. Still trying to figure out how to fix that...
EDIT I ended up making my msbuild output directory my output directory with '/bin' tacked on to the end, and I made my WebProjectOutputDir the real output directory.

How might i setup my ASP.NET project to find my files?

edit I do not want to redirect pages, specific files etc. I would like to change the path where images, videos and other media are stored from the root source directory to the directory of my choosing. In this case c:/dev/prjfiles/prjname/public (c:/dev/prjfiles/prjname/ is my working directory) and i except when my html does img src="/pic.png" it will find the image in c:/dev/prjfiles/prjname/publi/pic.png. I need a working solution, i tried looking at how to set virtual directories and etc. I cant figure it out. Thus the bounty. I am generating the html, i am not writing asp:image runat="server" etc i am pulling data from a DB and outputing the html. The part that is still a WIP is the code that handles POST request. The html already exist but i cant have hundreds of files in site.com/here pollution my source directory (c:/dev/trunk/thisprj/thisprj/where my .aspx files are and i do not wish 500 .png/gif/jpg here)
I dont know how asp.net environments are usually set up. I am assuming i have a root path that is not available from the web, a bin/ where i may put my asp.net dll and a public where i stick in any files i want.
I would like to have my project files seperated from everything else. My JS, css and image files are in prjfiles/prjname/public with my sqlite db in prjfiles/prjname/ and extra binaries in prjfiles/prjname/bin.
The problem comes when i run my app and try to load an image. Such as /cssimg/error.png. My project does not find resource in my /public folder and i have no idea how to make it find them. How can i set my project up so it does?
NOTE: I set the working directory path so its at prjfiles/prjname/. In code i write ./bin/extrabin.exe and db.sqlite3 which access the files properly.
You might want to watch the getting started videos for ASP.NET
http://www.asp.net/get-started/
EDIT: More info added
As #Murph suggests, your assumptions are incorrect.
IIS takes care of blocking HTTP access to any important files and folders like your *.aspx.cs, and *.cs in the App_Code, any DLLs, anything under the App_Data directory and the web.config.
Content files, such as *.html, *.css, *.js, .gif, .jpg, .png are all served in the normal manner.
In this way, there is no need for a "public" folder.
I dont know how asp.net environments are usually set up. I am assuming i have a root path that is not available from the web, a bin/ where i may put my asp.net dll and a public where i stick in any files i want.
This is wrong assumption!
You have a root folder, which IS available in public. You set IIS or ASP.NEt Development Server to this folder.
(optional, but always needed) You have a web.config file in this root folder for configuration
You have a bin folder for your assemblies (each page or user control "include" compiles to a class)
(optional) You have App_Data as default folder for file-based DBs and/or other data files (say XML storage, ..)
(optional) You have an App_theme folder for styling and images. Read about ASP.NET themes.
(optional) You can add App_Code folder if you want to add classes to be compiled by the server.
You can create folders for scripts, etc...
Normally for complex logic, etc.. you create in a separate project outside the root and reference the result assembly in the bin folder.
Seriously, you cannot do ASP.NET work without an IDE or a manual. Visual Web Developer 2008 Express IDE is free and http://asp.net has tons of resources for getting started.
I don't know if I got the question right, but maybe you could try the <BASE> HTML tag.
HTML <base> Tag
"Specify a default URL and a default target for all links on a page"
There's a nice and simple example at W3Schools, check it out.
The negative side is that you need to put a <BASE> tag in each page you want.
It sounds like you should be able to create a virtual directory to do what you're asking -- but it's a very non-standard setup.
Keep in mind that IIS will prevent users from downloading DLLs and other project-level files, so you usually don't need to partition them off in a separate layer.
For example, just have a cssimg folder at the top level of your project, and skip the whole public folder thing.
I see where you're coming from. ASP.NET projects are set up a little differently from how you're treating them, but you can make them work like you want.
The root of an ASP.NET project IS publicly accessible. When you created your WebSite within Visual Studio, it created a default.aspx page right on the root. Are you hosting in IIS? If so, it's set up to serve up default.aspx by default. But I digress.
Here's how to make it work like you want (mostly):
Create a WebSite, then right-click the site and add a folder named "prjfiles". Right-click that folder and make another named "public". Create another subfolder of that one called "cssimg".
Now, if you want to use the image you mentioned, you'd reference it like this: "~/prjfiles/public/cssimg/error.png" (pathing starting with the root) or "./cssimg/error.png" if you're coming from a page in the public folder (relative pathing).
Really, though, you're doing too much work. Here's how to make it work with less effort:
Create your WebSite, right-click the project and add a folder called "cssimg".
Treat the root as you would the "public" folder- put your pages right there on the root or in subfolders, as needed. You can reference that same image file like this now: "./cssimg/error.png" (relative) or "~/cssimg/error.png" (start from root)
There's also another way to tell the engine where to look for resources, but it's for your css files. Inside the "head" tag, you can add a "style" element (with type="text/css") and inside that you can add something like this: #import '<%= ResolveUrl("~/prjfiles/public/cssimg/styles.css") %>';
Good luck!
If I correctly understood your problem, you're trying to find files which aren't physically stored on a filesystem folder, or stay on a different folder. You can deal with this problems by implementing a UrlRewrite mechanism.
I suggest you to read URL Rewriting in ASP.NET and, after, to take a look into this implementation: A Complete URL Rewriting Solution for ASP.NET 2.0.
If I understand all this correctly (please comment with any correction) right now all your files are together in the root directory and you use <img src="/img.png" /> and it works.
If this is the case, make another directory in the directory the images are in, say call that directory images and put the image files there. now use <img src="/images/img.png" />.
Done.

Can i put URL rewriting http module in a folder?

I am trying to make a generic URL rewrite methods, and i want it portable so i checked this article: http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx which is very nice.
But i want to put all my classes, http modules in one folder, then i can just paste this folder in any asp.net website and edit the web.config to point to this http module, thats it, without the need to add anything in the APP_Code as this article teaching.
My question is is that possible? any conc or better ideas?
The ASP.NET runtime only looks by default in a limited number of folders for code files that it compiles on the fly -- App_Code (and its subfolders) is one of them. If you place code in an arbitrary folder, it won't be found.
The usual approach for what you describe is to build a DLL, and then drop it into the web site's bin folder. You would then have a separate project in Visual Studio for building the DLL. Using a subfolder in App_Code is another possibility.
You could also put your DLL into the GAC, which would make it accessible to all sites on a server.
You always can to compile that code into an assembly (.dll), place it inside your /bin folder and to update your web.config file.

Resources