Content file int the bin folder not found
Hello, I have been having a problem accessing to a content file on my BaseballApp application.
I have a file called AccountConfirmationEmail.cshtml that when i deploy my application is on the bin folder. The build action for this file is set to Content and the Copy to output directory is set to copy always. The file is being added to the bin folder, I have confirmed this, by downloading the build file from appharbor.
For some reason this works on my local environment but in appharbor is giving me this error:
Could not find a part of the path 'D:\\Users\\apphbe763bc4cc16217\\app\\_PublishedWebsites\\BaseballAppAPI\\bin\\EmailTemplates\\AccountConfirmationEmail.cshtml'
And the file is there, I don't understand why it says that is not found.
I added this section to the web config to include the mimeType
<staticContent>
<mimeMap fileExtension=".cshtml" mimeType="text/html" />
</staticContent>
But it doesn't work.
What do you think is the reason of this error ??
Thanks in advanced.
Discussions are closed to public comments.
If you need help with AppHarbor please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by jesusmendoza25 on 10 Oct, 2016 04:29 PM
I just saw in the build file downloaded from appharbor that the EmailTemplates folder is not created on the bin folder, is created in the root folder but locally it creates the EmailTemplates folder into the bin folder.
I don't know why this difference deploying the application.
Thanks in advanced.
Support Staff 2 Posted by rune on 12 Oct, 2016 12:07 AM
Hi,
I suspect the difference between environments is related to the way AppHarbor processes your build. In particular, AppHarbor will set an
OutDir
parameter when running msbuild, which will output the compiled app to a different directory than the input directory. This is usually not an issue as web applications will haveContent
resources copied as expected, but I took a look at your application and it appears that theEmailTemplates
are associated with a regular library project, rather than the web app itself.If that's the case there are a couple of ways to approach this:
xcopy
post build event that does just that.While debugging it may be helpful to try and execute
MsBuild
directly with theOutDir
parameter set as this will allow you to replicate AppHarbor's build process more in this regard.Let me know if this doesn't help address the issue, or there's anything else I can help with!
Best,
Rune
rune closed this discussion on 12 Oct, 2016 12:07 AM.