Goal: Have resource load on LOCAL site, not just PRODUCTION site.
Summary: I have a C# .NET Chat application that loads into an iframe in an Angular site. It works fine on PRODUCTION but I am having trouble getting everything to run on my VM (particularly, certain resources won't load at the proper location)
LOCAL Chat Site (on my VM): localhost:7078
PRODUCTION Chat Site: www.site.com/chat
Relative path to resource: "/chat/content/images/file.png
- If I change this in the .aspx code, it makes the LOCAL site work, but breaks the PRODUCTION site
- Want to keep /chat/ for the Production site, but LOCAL does not work with that
On LOCAL, Get error: "GET http://localhost:7078/chat/Content/images/file.png 500 (Internal Server Error)"
- Actually loads at: /content/images/file.png
I have worked at this for days, looking up information about IIS and applicationhost, application path, relative path, virtual directories, etc. Every solution errors out in some way. I've looked through Microsoft documentation, SO articles, blogs, youtube vids, etc.
I have tried altering the applicationhost.config, web.config, ProjectURL, etc. This is what they look like prior to any changes:
applicationHost.config: (from \Solution.vs\config)
<site name="ChatServer" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Folder\Subfolder\Application\ChatServer" />
</application>
<application path="/chat" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Folder\Subfolder\Application\ChatServer" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:7078:localhost" />
</bindings>
</site>
web.config:
<system.web>
<!-- Classic Mode (IIS 6 and Visual Studio) -->
<httpHandlers>
<add path="websync.ashx" verb="*" type="FM.WebSync.Server.RequestHandler" />
</httpHandlers>
<httpRuntime maxRequestLength="20000" executionTimeout="300" />
<compilation targetFramework="4.6.1" debug="true" />
<pages controlRenderingCompatibilityVersion="4.0" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<!-- Integrated Mode (IIS 7+) -->
<handlers>
<add path="websync.ashx" verb="*" type="FM.WebSync.Server.RequestHandler" name="WebSync Handler" preCondition="integratedMode" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="20480000" />
</requestFiltering>
</security>
</system.webServer>
I'm sure there is something annoyingly simple that I am missing, could someone please help point me in the right direction?