Webdeployment error
Hi,
When I use the web deployment tool for my website, it runs fine withouth any errors.
I copy the folder to my production server and I'm getting this error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Sitefinity/Licensing
Hi,
The problem may be because some of our aspx and ascx files cannot be precompiled since they are distributed as embedded resources inside the binaries(not as external files) and are provided through a Virtual Path Provider in a faked(non-present on the disk) virtual sub directory. In such case it is necessary to remove the PrecompiledApp.config, e.g. the site should run in updatable mode. You might also want to tick the Allow website to be editable checkbox, when using the deployment tool.
I hope this information helps you resolve this issue. If you need any further assistance, please do not hesitate to contact me.
Regards,
Boyan Barnev
the Telerik team
Hi Daniel,
Did you find a solution for this? I have not been able to successfully delpoy sitefinity using the Web Deployment Tool because Global.asax essentially doesnt fire as it needs to precompiledapp.config file - which sitefinity wont work with.
I've opened several support tickets but not solution yet.
Any ideas?
Thanks
Al
Hi Daniel,
If you're interested I found a solution. It basically involves excluding the global.asax files from the build and then copying them back into the output directory in the AfterBuild section.
I'll provide some code if you still need it.
Cheers
higgsy
Hi,
Tried that, but it didn't work for me. Maybe I did something wrong.
Would be great if you would share your code.
Thanks!
Hi Daniel,
Ok so. Make sure the Build Action for both the Global files is set to None and "Do not copy". You will also need to change the syntax of the Global.asax file to reference CodeFile not CodeBehind. Also change the Global class from public to partial. One other thing, the namespace that your global class is within is probably the same as your compiled DLL - this will produce an error because you chose to exclude the Global from the build - therefore change the namespace referenced in your global - I have just called the namespace root.
So, I end up with the following:
Global.asax
<%@ Application CodeFile="Global.asax.cs" Inherits="root.Global" Language="C#" %>
namespace
root
partial
class
Global : System.Web.HttpApplication
<
ItemGroup
Condition
=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
>
<
ExcludeFromBuild
Include
=
"$(SourceWebPhysicalPath)\Global.asax"
/>
<
ExcludeFromBuild
Include
=
"$(SourceWebPhysicalPath)\Global.asax.cs"
/>
<
Target
Name
=
"AfterBuild"
Condition
=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU' Or '$(Configuration)|$(Platform)' == 'LiveLocal|AnyCPU'"
>
<
ItemGroup
>
<
FilesToDelete
Include
=
"$(OutputPath)\PrecompiledApp.config"
/>
</
ItemGroup
>
<
ItemGroup
>
<
GlobalAsaxFilesToCopy
Include
=
"$(SourceWebPhysicalPath)\Global.asax;$(SourceWebPhysicalPath)\Global.asax.cs"
/>
</
ItemGroup
>
<
Delete
Files
=
"@(FilesToDelete)"
/>
<
Copy
SourceFiles
=
"@(FilesToCopy)"
DestinationFolder
=
"$(OutputPath)\App_GlobalResources\"
/>
<
Copy
SourceFiles
=
"@(GlobalAsaxFilesToCopy)"
DestinationFolder
=
"$(OutputPath)\"
/>
</
Target
>
Thanks, I'll give it a try.
Regards,
Daniel