How can I get aspnet compiler to handle a page that contains an include file - msbuild

I have a web application that lands on a shared hosting platform for my company. That platform has global header/footer code that all applications on the platform consume using include files. I can't change how the header files are structured and how they are to be cosumed--that is dictated to me by another group. I have a build server that does not has IIS installed by design. I am attempting to use the aspnet_compiler.exe during the build process to generate the precompiled website files for deployment.
However, when the build runs I get errors like this:
/Company/Controls/Header.ascx(7): error ASPPARSE: Failed to map the path '/sites/header.inc'.
The Header.ascx control has this server-side include in the HTML:
<!-- #include virtual="/sites/header.inc" -->
On my local machine, I have created a virtual directory in IIS named "sites" that points to the global header code (which I have also copied to my local machine). This same "sites" virtual exists in IIS on the hosting environment. I would really like to avoid having to install IIS on the build machine because it is a shared build machine and I don't anyone to mistakenly work IIS dependencies into their code. The build machine shouldn't need to have IIS.
What is the best way to get the precompiled site files that aspnet_compiler.exe produces during my build without installing IIS?

Microsoft has a very simple example of how to replace an include statement...
http://support.microsoft.com/kb/306575
Looking at the path of your error it seems you are already using some sort of global user control and I'm guessing this is a file which is reused by other applications or languages so I would suggest coming up with a more custom version with error handling and such since it is working over a mapped drive but the basic answer is you need to read the file and output it to the stream during the Render event.

Don't use server-side includes. They are ancient technology and are disabled on most modern sites.
I recommend you instead create .ascx files to replace each of the .inc files, and use those instead.

Try this:
<!-- #include virtual="~/sites/header.inc" -->
The ~ is a shortcut for "root of the web application."

Related

IIS can't serve WebAssembly module

I'm using PSPDFKit SDK and I'm trying to load it within my page. It loads just fine locally, but when it comes to stage I'm getting this error:
Error: Error loading https://***.com/mcclubone/_ATF/Inc/PSPDFKit/pspdfkit-lib/pspdfkit-bb2d75a643cc7546.wasm: Not Found at 500d608b-a6cc-4154-b84a-5d35a6e80ca9:12:135914".
It looks like stage's IIS can't serve WebAssembly modules, but I did add that 'application/wasm' type to MIME types in IIS config what should make it work and it doesn't happen. I've compared both (local and stage) environments and their confings are the same. The only difference is that locally I'm using IIS for Windows 10 and on stage it's IIS for Windows Server 2012.
I think this issue is related to serving .wasm files and not specifically to PSPDFKit.
Can anybody suggest something to solve that painful problem?
This has been solved. Due to the fact that we have a complex network hierarchy and structure, the folder was copied incorrectly, hence IIS couldn't find the file that was being requested.

How to run app from root url (localhost:port/) instead of (localhost:port/path/index.html)

This is a problem that I have when I run/debug the app from Webstorm.
The run/debug configuration dialog doesn't give us much to work with, we can just specify the path of the index.html file there.
I wanna be able to set up a configuration similar to what yeoman's angular generator gives us out of the box.
WebStorm built-in web server serves the project from 'http://localhost:<built-in server port>/<project root>'. If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559. But, as it's mentioned in this comment, there are currently some issues with serving dart apps on server configured this way.
Please follow WEB-14047 for updates

Imageresizer remote reader plugin not working on live site

I have followed the imageresizer's troubleshooting for when images do not appear as they are listed here:
Potential causes:
You are using the .jpg.ashx syntax, and you did not register the HttpModule properly in both places of your Web.config file.
You are using the .jpg.ashx syntax, but you're not using a query string. You should drop the '.ashx' unless you actually want to process the file.
You are using ASP.NET MVC, but do not have the MvcRoutingShim plugin installed.
You have Precompilation enabled, and are using an image provider. This is caused by a long-standing bug in the .NET framework.
However, everything works perfectly in my local development environment. I have the MvcRoutingShim plugin installed and all the correct web.config references. On the live site, all images referenced by either just a querystring OR the RemoteReaderPlugin.Current.CreateSignedUrl procedure are not found.
All images are resulting in a 404 error.
Any ideas?
The answer: DiskCache(ConfigurationError): Not working: Your NTFS Security permissions are preventing the application from writing to the disk cache
Please give user read and write access to directory "C:\inetpub\wwwroot{site}\imagecache" to correct the problem. You can access NTFS security settings by right-clicking the aformentioned folder and choosing Properties, then Security.

Web Service Reference to reportservice20xx.asmx on a distributed application

I have an .Net webapplication which connects to a reporting web service.
In my development studio, I just add an webreference, then specify the path where the reporting server is installed and reportservice2010.asmx is found and ready for use.
But i do not know how to deal with it, after my application is compiled.
When I would like to distribute it on lets say 100 different servers.
The path to reportservice2010.asmx may(and surely will) change.
Of course what will make my application corrupt.
Please help !
When you added the web reference, Visual Studio should also have added a new section to the application's configuration file. That section specifies the environment-specific details of the web reference.
If, for any given target environment, the target address of the web reference changes then you can simply change the URL in the application's configuration file.

httpHandler works for virtual directory but not similarly configured website

I am setting up a 3rd party website which makes heavy use of httpHandlers. When configured as a virtual directory under Default Site on a 2003/IIS6 machine, everything works as expected. When configured as a standalone site on the same machine, pointing to the same directory and web.config however, httpHandlers do not work (404).
I have tried various changes to the path values of the handler's tags with no results. The pages themselves, and the application's code, all seem to execute find within the standalone site.
Any obvious things I might be missing?
Found my own answer, was a very simple thing.
An installer package had installed the virtual directory version of the site, and it had taken care of adding the file extension mappings. The standalone was manually configured and as such, I missed adding the mappings.
Resolved.