Webdeployment error

Posted by Community Admin on 03-Aug-2018 15:14

Webdeployment error

All Replies

Posted by Community Admin on 26-Feb-2011 00:00

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

I tried to put the license file in that directory, but it didn't work?

Regards,
Daniel

Posted by Community Admin on 01-Mar-2011 00:00

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

Posted by Community Admin on 05-Sep-2011 00:00

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

Posted by Community Admin on 06-Sep-2011 00:00

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

Posted by Community Admin on 06-Sep-2011 00:00

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!

Daniel

Posted by Community Admin on 06-Sep-2011 00:00

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#" %>

Global.asax.cs
namespace root
 
    partial class Global : System.Web.HttpApplication

Then in my web deployment project:
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
        <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\Global.asax" />
        <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\Global.asax.cs" />

and...
<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>

So - you shouldn't end up with a compiled global.asax.compiled file in the bin directory as we have excluded it from the build. Then afterwards we have copied it back into the output folder.

In my global file I am registering dialogs which is now working perfectly.

If this doesnt work let me know what errors you get.

higgsy

Posted by Community Admin on 06-Sep-2011 00:00

Thanks, I'll give it a try.

Regards,
Daniel

This thread is closed