I am deploying an ASP.NET MVC 4 application on IIS 7.5 on a Windows 2008 R2 machine.
The app works alright locally in the Visual Studio Web development server.
But when deployed, I get a 504 http status code.
The app runs in a custom application pool under the ApplicationPoolIdentity identity and in Integrated mode. The app pool is enabled to run both 32-bit and 64-bit applications and targets v4 of the .NET framework.
The app assemblies were build targeting "Any CPU".
When I deploy the application and attempt to access it, in addition to receiving the 504 Http status code, I also see this in the event viewer.
Event Data
HRESULT 0x8007000d
PhysicalPath \\?\C:\Windows\Microsoft.NET\Framework\v4.0.30319\CONFIG\web.config
Type 3
Message Unrecognized element 'providerOption'
LineNumber 53
PreviousLine <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
ErrorLine <providerOption name="CompilerVersion" value="v4.0"/>
NextLine <providerOption name="WarnAsError" value="false"/>
The above configuration pertains to CodeDOM, a set of classes in the System.CodeDom namespace in the System.dll assembly that ASP.NET uses to generate our "code behind" classes.
The CodeDOM configuration has changed from v2 of the .NET framework to v3.5.
I missed the part where the above error gives me the path of the web.config it is complaining about. The path is C:\Windows\Microsoft.NET\Framework\v4.0.30319\CONFIG\web.config and that file did have this <providerOption> element.
I commented that out. This error is now gone.
However, I still have other issues to deal with but this one goes away. So, anyone else in the future who faces this error might use this answer as help.
I try to publish a web application from my VS2012 to a remote computer.
I published the files but when I try to open the website, I get this error:
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note
that attribute names are case-sensitive.
Source Error:
Line 41:
Line 42: <compilation targetFramework="4.0" />
Line 43: <httpRuntime targetFramework="4.0" />
Line 44: <authentication mode="Forms">
Line 45: <forms loginUrl="~/" timeout="2880" />
(line 43 is in red )
On the remote computer :
* IIS7 is installed (and also IIS6, I think)
* ASP.NET 4.0 is installed
* "aspnet_regiis -ir" > installed successfully
* IIS7 > Application Pools > ASP.NET 4.0 > poining to ".NET Framework v4.0.30319"
* IIS7 > my web application > "ASP.NET 4.0" (Integrated) is chosen.
I don't know if it 's important but server's windows is Widows Server 2008 RT Enterprise 64-bit and my computer is windows 7 32-bit.
Nothing helped...
The httpRuntime did not have targetFramework available for set, remove it and it will work.
I had similiar issue when I try to publish the website.
The code compiled fine in both Debug and Release but got Unrecognized attribute 'targetFramework'... while publishing the site after updating my solution to .net 4.7.2 from older version .net3.5
I then updated my .pubxml file to contain
**<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>**
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<WebPublishMethod>FileSystem</WebPublishMethod>
It worked for me then
I tried to open ASP.Net Website , but I received this error.
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
what is this about ?
below links are very much helpful you can refer to it :
http://blogs.msdn.com/b/webtopics/archive/2010/04/28/system-typeloadexception-for-system- servicemodel-activation-httpmodule-in-asp-net-4.aspx
http://social.msdn.microsoft.com/Forums/en/wcf/thread/39571e42-aca7-469d-8c68-aa59c2da4fcc
This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:
aspnet_regiis.exe -iru
OR
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
good luck
Hello,
I convert the project visual studio & the crystal reports to Version 10
but the server has the old version so i have to add the old references
IT show the report but i'm having a problem on printing and engine issue
Crystal Report Bar Engine :
Server message :
Local message :
Server Error in '/' Application.
--------------------------------------------------------------------------------
HTTP Error 404 - Not Found.
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 10.0.0.0
Tried :
-- Re install the Crystal Report 10 .
-- Delete all Crystal Report references and add it again .
-- Clean the Solution , remove the references and add it again .
(~ latest result (current status):
I realized that i have install CRforVS_13_0_2 that have the package CRRuntime_64bit_13_0_2.msi and my computer is 32-bit operating system .. so i install CRRuntime_32bit_13_0_2.msi and it finished the installation unlike CRRuntime_64bit_13_0_2.msi .. but the problem with Business Objects still there as it shown in the "Crystal Report Bar Engine " image . ~)
Note : If i add the new references of crystal report ,it sure work on the local but not on
the server . So i have to work with the old references.
HELP .
Analyze the problem
It's possible to analyze the problem, and find a 403 (Forbidden) error
using client tools (debug window of browser)
GET http://someServer:20080/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js 403 (Forbidden)
GET http://someServer:20080/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/images/style.css 403 (Forbidden)
or server tool (IIS log , on WIN2003 is placed in %SYSTEMROOT%\System32\LogFiles\W3SVC###\).
2011-03-28 13:00:49 W3SVC701536 95.228.38.41 GET /aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/images/style.css - 20080 - 192.168.1.2 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+Trident/5.0) 403 6 64 Errore!
2011-03-28 13:00:49 W3SVC701536 95.228.38.41 GET /aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js - 20080 - 192.168.1.2 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+Trident/5.0) 403 6 64 Errore!
Cause the problem
In both cases i found that crv.js and style.css some files were not served;
these files are placed by CR installer in wwwroot\aspnet_client folder, but for some reasons they cannot be reached;
In my case the reason is that i create a different website (port 20080) and aspnet_client folder is not placed inside that website
I can see that you use different versions of software and different configurations, but i think you have the same problem.
Solution
The solution is to work on IIS this way:
Copy aspnet_client folder from c:\inetpub\wwwroot folder to the new website root folder.
or (this one is better)
Create a virtual directory called aspnet_client that points to c:\inetpub\wwwroot inside the new website
I think you miss path of report. Please check report path at loading time. Because i have already fetch same issue. So change path in publish version on server.
May be this help to you....
OK ,
( ~ If the server has the older version, then you have to make your framework &
Crystal Reports References compatible with the server sittings . ~ )
So in my case i changed all of my projects framework to framework 3.5 and all my
Crystal Reports References to version 10.5.3700.0 . And still using the 2010 Visual Studio .
IT is working fine now . Thanks for helping guys .
To avoid copying aspnet_client folder simply add in webconfig:
<businessObjects>
<crystalReports>
<crystalReportViewer>
<add key="resourceURI" value="~/localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13"/>
</crystalReportViewer>
</crystalReports>
</businessObjects>
Note: aspnet_client folder must be configured as an application in IIS
This worked after adding the section shown in the image, in the webconfig
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304, Custom=null"/>
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true"/>
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13"/>
</crystalReportViewer>
</crystalReports>
</businessObjects>
I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find.
delete app_code, build, add files back, publish. (did not work)
delete temporary asp.net files (did not work)
In the end I even tried the command line and get the following stacktrace.
error ASPRUNTIME: Object reference not set to an instance of an object.
[NullReferenceException]: Object reference not set to an instance of an object.
at System.Web.Compilation.BuildManager.CopyPrecompiledFile(VirtualFile vfile,
String destPhysicalPath)
at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect
ory sourceVdir, String destPhysicalDir, Boolean topLevel)
at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect
ory sourceVdir, String destPhysicalDir, Boolean topLevel)
at System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect
ory sourceVdir, String destPhysicalDir, Boolean topLevel)
at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath star
tingVirtualDir)
at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirt
ualDir)
at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallba
ck callback)
at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa
llback callback)
at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa
llback callback)
at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil
dManagerCallback callback, Boolean forceCleanBuild)
at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil
dManagerCallback callback)
at System.Web.Compilation.Precompiler.Main(String[] args)
I used the following command line:
aspnet_compiler.exe -p d:\code\websites\brokerweb -v / d:\code\websites\published -f -c -errorstack -u
This error was occurring for me when I tried to compile the project with MSBUILD - it would build fine within Visual Studio, and would even Debug in my local browser. The Publish option within VS worked, as well. But the command-line MSBUILD was causing the project to error out every time.
I managed to fix this problem in VS 2012 by opening the Property Pages on my Website, opening the 'MSBuild Options' tab, and unchecking the 'Allow this precompiled site to be updatable' option, then hitting 'save all'.
I had the same experience and removing the compressed flag from the solution directory tree, set the compiler working again.
This typically happens when a *.dll.refresh file in the bin directory points to a location that is no longer available. Deleting the *.dll.refresh files should resolve the issue.
I know this is an old post, but just in case someone will find this usefull:
The cause of this problem for me was the McAfee anti-virus
ASPNETCOMPILER(0,0): Error ASPRUNTIME: Object reference not set to an instance of an object
I had a similar problem when compiling views in MVC WebApplication. NullReferenceException was thrown only when building solution inside VS or MSBuild. Running aspnet_compiler.exe from command line was without errors.
error ASPRUNTIME: Object reference not set to an instance of an object.
[NullReferenceException]: Object reference not set to an instance of an object.
at System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart)
at System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart)
at System.Web.Compilation.WebDirectoryBatchCompiler.CacheAssemblyResults(AssemblyBuilder assemblyBuilder, CompilerResults results)
at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(AssemblyBuilder builder)
at System.Web.Compilation.WebDirectoryBatchCompiler.<CompileNonDependentBuildProviders>b__0(AssemblyBuilder assemblyBuilder)
at System.Web.Compilation.CompilationUtil.CompileParallel(ICollection assemblyBuilders, Action`1 action)
at System.Web.Compilation.WebDirectoryBatchCompiler.CompileNonDependentBuildProviders(ICollection buildProviders)
at System.Web.Compilation.WebDirectoryBatchCompiler.Process()
at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback, IEnumerable`1 excludedVirtualPaths)
at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)
at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback)
at System.Web.Compilation.Precompiler.Main(String[] args)
After a day of looking for answers on web and discovering with ProcessMonitor, I found out that it was happening when compiler tried to compile ReportService.svc file. If this file was deleted or extension renamed, everything compiled just fine.
Very strange resolution fixed problem of compiling svc files. A few days ago I turned on ntfs compression on this project to save some space. And this was the only problem. When ntfs compression attribute was removed from website folder, NullReferenceException problem was resolved.
I have recently encountered this Error. As #samiz mentioned above, First of all, you need to delete all *.dll.Refresh after that build and publish your website. However, sometimes, as happen for me, when you have deleted *.dll.refresh, then publish your website, Error reminds as usual. I have done a lot of tests, but nothing changes.
I also create a new folder and copy all *.dlls which I need for my website. Next, delete all *.dll inside Bin folder then add them by one.
Finally, I re-start My PC, and then I try to publish my website. Believe me or not, it works fine and no error occurred.
I had a similar issue. The application would build and run in the IDE, but fail to publish; conking out at the 'merge dll into single assembly' stage. After researching aspnet_merge.exe I found that the issue was resolved by unchecking the 'emit debug information' checkbox in the publish options.
It may not be a 'clean' fix for the issue, but it's a workaround.
Hope this helps.
Andrew
Deleting all the *.compiled files from Bin folder of the website works for me. :)
These files are safe to delete and are created during precompilation. For more info check this MSDN link.
In Visual Studio 2017, none of the solutions given here worked for me. I was able to solve the problem by the following steps:
Exit Visual Studio if its running
Open Visual Studio Installer from the start menu
Under the Installed tab, it will display the version of Visual Studio on your computer
Click the More option and select Repair
After the repair operation is complete, relaunch your project in Visual Studio
Now you shouldn't get this error when you click Publish
In my case, clearing cookies resolved the issue.
The StackTrace had mentioned some authorization and cookies thing. I opened the web application in InCognito mode (which do not persist cookie store) and found the app working.
Hope it helps somebody.
Again, this is an old post, but I had the following:
VS2012 asp.net web forms app -> upgraded to VS2013
Try to publish - get same error as OP.
When I finally figured it out, the problem was caused by one thing:
when I looked into the membership providers in web.config, one item was missing the connectionStringName attribute:
bad:
<membership defaultProvider="SomeMembershipProvider">
<providers>
<clear />
<add name="SomeMembershipProvider" type="System.Web.Security.SqlMembershipProvider" passwordFormat="Encrypted" applicationName="SomeAppName" />
<add connectionStringName="SomeConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/SomeAppName" requiresUniqueEmail="false" blaw blaw blaw />
</providers>
</membership>
good:
<membership defaultProvider="SomeMembershipProvider">
<providers>
<clear />
<add name="SomeMembershipProvider" connectionStringName="PerhapsSomeOtherConnectionString" type="System.Web.Security.SqlMembershipProvider" passwordFormat="Encrypted" applicationName="SomeAppName" />
<add connectionStringName="SomeConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/SomeAppName" requiresUniqueEmail="false" blaw blaw blaw />
</providers>
</membership>
I'm not sure why one of the connectionStringName attributes was stripped out, or even if it was ever there, but you can turn this error on and off with this one setting.
I had the same problem when I tried to publish my webservice. The problem was that the PrecompiledApp.config file that gets created when you publish your website to a directory was some how added to my project. With that added, it caused the error.
The resolution: I deleted the file from my project tree in Visual Studio and then I was able to publish the webservice again with the precompiled settings enabled/checked.
make sure you are not publishing directly on virtual directory. if yes, stop the site then publish then restart the site.
upgrade your Visual Studio to VS 2013. it solved the issue for me. :)