When I deploy my project the help file with the mht extension does not get copied across to the drop folder with the rest of the project.
Why is this, and how do I fix it?
I am using tfs 2010.
I do not know how the problem was caused in the first place, but I found the way to fix it is to edit the .prog file.
The <ItemGroup> was corrected as follows;
<Content Include="Views\Leaver\ConfirmSubmission.cshtml" />
<Content Include="Help\Help.mht" />
<!--<None Include="Help\Help.mht">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>-->
So I replaced the commented out code with the line above, ie <Content Include="Help\Help.mht" />
and now it works.
Related
I am trying to get my head around how F# code is organised.
I understand that in a folder or main directory - to access code from a different file, the file must be above it, and I can move code up or down using Alt+Up , Alt+Down - makes sense.
However, if I Have some code in a subdirectory - even if that subdirectory is above the code it does not appear to be able to access it. If the subdirectory is in a parent directory it seems to be Ok. I can't seem to find the rationale for that anywhere. Thoughts?
However, if I Have some code in a subdirectory - even if that subdirectory is above the code it does not appear to be able to access it.
This doesn't sound correct. All that matters is the order of the files in the project file, so if you have this in your .fsproj file:
<ItemGroup>
<Compile Include="MyFolder\MyFile.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
Then Program.fs can access things defined in MyFolder\MyFile.fs. If you are seeing something different, please share the details.
ASP.NET MVC4 Bootstrap 3 application is running from Microsoft Visual Studio Express 2013 for Web IDE.
Chrome console shows always error
http://localhost:52216/admin/fonts/glyphicons-halflings-regular.woff2
Failed to load resource: the server responded with a status of 404 (Not Found)
This file exists in the fonts directory in the Solution Explorer. Build action is set to "Content" and Copy to Output directory is "Do not copy like in other font files".
Bootstrap 3 is added to the solution using NuGet.
How to fix this so that this error does not occur?
Application shows Glyphicon and FontAwesome icons properly. This error always occurs at application startup.
This problem happens because IIS does not know about woff and
woff2 file mime types.
Solution 1:
Add these lines in your web.config project:
<system.webServer>
...
</modules>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
Solution 2:
On IIS project page:
Step 1: Go to your project IIS home page and double click on MIME Types button:
Step 2: Click on Add button from Actions menu:
Step 3: In the middle of the screen appears a window and in this window you need to add the two lines from solution 1:
In my case, I've just downloaded the missing file directly from here: https://gitlab.com/mailman/mailman-website/raw/a97d6b4c5b29594004e3855f1ab1222449d0c211/content/fonts/glyphicons-halflings-regular.woff2
Add this one to your html if you only have access to the html:
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
For me, the problem was twofold: First, the version of IIS I was dealing with didn't know about the .woff2 MIME type, only about .woff. I fixed that using IIS Manager at the server level, not at the web app level, so the setting wouldn't get overridden with each new app deployment. (Under IIS Manager, I went to MIME types, and added the missing .woff2, then updated .woff.)
Second, and more importantly, I was bundling bootstrap.css along with some other files as "~/bundles/css/site". Meanwhile, my font files were in "~/fonts". bootstrap.css looks for the glyphicon fonts in "../fonts", which translated to "~/bundles/fonts" -- wrong path.
In other words, my bundle path was one directory too deep. I renamed it to "~/bundles/siteCss", and updated all the references to it that I found in my project. Now bootstrap looked in "~/fonts" for the glyphicon files, which worked. Problem solved.
Before I fixed the second problem above, none of the glyphicon font files were loading. The symptom was that all instances of glyphicon glyphs in the project just showed an empty box. However, this symptom only occurred in the deployed versions of the web app, not on my dev machine. I'm still not sure why that was the case.
I tried all the suggestions above, but my actual issue was that my application was looking for the /font folder and its contents (.woff etc) in app/fonts, but my /fonts folder was on the same level as /app. I moved /fonts under /app, and it works fine now. I hope this helps someone else roaming the web for an answer.
This problem happens because IIS does not find the actual location of woff2 file mime types. Set URL of font-face properly, also keep font-family as glyphicons-halflings-regular in your CSS file as shown below.
#font-face {
font-family: 'glyphicons-halflings-regular';
src: url('../../../fonts/glyphicons-halflings-regular.woff2') format('woff2');}
When I deployed my app I had to add following code to my web.config file because otherwise the server won't display my .svg file
<system.webServer>
<staticContent>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
<system.webServer>
However, if I leave that bit of code in the file while I develop on my machine, it leads to weird errors (e.g., my machine doesn't load my .css file anymore). All works fine if I comment that out again while working locally.
But exactly that is a hastle, commenting/uncommenting that code always when developing resp. deploying.
So my two questions:
1) Is there a way to include code conditionally in the web.config, e.g., depending on if degug or release build, or if deploying?
2) Why is that code causing trouble on my local machine in the first place?
UPDATE: So Q1 is answered, but still looking for an answer to Q2! Can't accept an answer before that ...
In your web.config File you have an arrow that points to two other Files called Web.Release.config and Web.Debug.config there you can make such changes. There you can modify your web.config based on your Run Mode.
There is a very good Microsoft Article about it im pretty sure it will help you
https://msdn.microsoft.com/en-US/library/dd465326(VS.100).aspx
I have integrated (Twitter)Bootstrap to my ASP.NET MVC (4) application.
In my source code I have the following fonts files:
When I publish my application only the .svg file are being included in this fonts folder.
I have also this img folder being part of bootstrap:
All images files are being included when I publish my application.
So, how can I get VS2013 to copy those fonts files when publishing the application?
A temporary solution,
Select your font files and Change Build action as Content from Properties Window. This fixes it in the immediate, but leaves you open to missing files in the future.
To permanently fix this issue this may help,
You can fix this permanently by modifying the default Build Action for font file extensions (.eot, .ttf, etc)
Visual-Studio-default-build-action-for-non-default-file-types
In my case I was deploying to azure and below modification in the web.config fixed my problem.
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff" />
</staticContent>
</system.webServer>
Refer this link
I noticed that the "Precompile during publishing" checkbox in the "File Publish Options" in VS2017 prevented a *.lic file from being included in the deployment despite it being configured as "Content". A *.txt file did not have this problem, so I assume this has something to do with "unknown" file extensions.
I'm not sure if this is specific to VS2017 or other versions also have this weird issue.
Anyway thought I'd share this because it is very counter-intuitive, seems totally unrelated to that checkbox and might help somebody having similar issues.
What happened to our Umbraco instance? It looks like this when I'm logged in, and when I check the browser console I see lots of 500 Internal Server Errors for both the backoffice and the front-end website, with failures for .css and .js files.
I've tried recycling, stopping and starting the app pool, and restarting IIS. I've tried updating the clientDependency version number in clientDependency.config, that didn't work.
I double-checked and I'd added a mime-type via the web.config (in the section), and I'd also added it as a mime type via IIS. This breaks loading of static content, so I defined the mime-type in the web.config only and removed it from IIS, and this fixed the issue.
I tries to load a gif-file and just like ProNotion says:
I found this line in web.config without any remove element:
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
Add change to
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
That fixed the issue for me.
It's likely a permissions problem. I'd suggest that you first need to try and find some detail on the 500 error. Can you inspect it for further detail?
If that doesn't help disable the ClientDependency framework by setting debug="true" on the compilation node of youur web.config file. It's located under the system.web node and looks like this:
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.0">
If you still have issues after that you can at least browse directly to those resources to view details of the error.
Simon