Parser Error Message: Could not load type 'webmarketing'

寵の児 提交于 2019-11-28 06:18:25

I had same problem before i just change CodeBehind to CodeFile and it worked.I remember it works in local but i had this problem after uploading.

This is normally happening when you copy files from a Web application projects to Website Project.

When you create a Web Application the Page directive is CodeBehind for the web pages.

If you create your application as Website then the Page directive is CodeFile

So if you copy from a Web application to Website the Namespace as well as the page directive will not change automatically, you should do this manually to rectify this error.

I had this error message. The problem was my .cs and aspx files were not added to the project. They were in the folder, but were not added. I solved it by adding them to the project (right click, Add). And then after I built the project, it was compiled into a dll in the bin folder. There was no need to change the text from CodeBehind to CodeFile.

regarding the Inherits is should reflect the full name space with class name such as x.y.webmarketing, not the class name or the file name. to wrap it up it should look like below

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.Master.cs" Inherits="Lync_Billing.ui.MasterPage" %>

what i did to solve my problem giving the same message was to go to IIS and check if it is configured as an Application or simply as a virtual directory. The App icon was just a folder icon. So i right clicked it and Manage Virtual directory > Advanced Settings > convert to Application changed the icon of virtual directory to a green earth icon. Of course the app was targeting framework 4.5, so changed App pool to 4.0 from default app pool, which was there earlier. This solved the issue for me.

But some things i did not say, 1. I am running it locally on IIS 6.1. 2. I am accessing with domain credential and not with 'pass through' authentication. Hope this helps

If your application works in your local but fails when deployed to the server, then this issue is most likely related to your IIS settings.

To resolve this, Make sure the “Enable 32-Bit application” property of the target Application pool in IIS is set to “TRUE”. It WORKS!

I think you find the problem is you need to update the files in the BIN folder. When you run the app it recompiles the files in the BIN folder too. Copy those up to the WEB site and that should fix the problem, it did for me. This is especially true if you create a new page that was not already there which was my case.

If you are facing this error after Hosting your Website on server make sure that you create the directory And/Or go to Hosting server -> Site Manager -> Application Starting Point ,select the proper path or folder of your uploaded Published Folder.

It resolve my same problem , I hope it will help you also.

In case you encounter this during debugging on your Visual Studio running on a 64-bit operating system, and your application is a 32-bit, set your configuration manager to x86 (32 bit). This agrees to the previous answer to the set IIS to enable 32-bit application on 64-bit.

Using VS2015, I checked "Delete all existing files prior to publish" under File Publish Options within the "Publish Web" right-click menu option and this problem went away.

For me, I rebuild the individual projects and then rebuild the entire solution. That worked for me somehow. Simply building the solution may not work. I think when you "Clean" the solutions that will fix the issue.

I'm using "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version 1.0.8. When rebuilding there was a warning about not being able to copy files into bin\roslyn. So I stopped IISExpress, deleted the bin folder and rebuild the project. There were no build warnings and the application worked fine.

Non of the mentioned answers worked for me.

My error was the same but I made the mistake and published the Debug version and not release, so make sure before Publishing your project, switch to Release, Clean and Rebuild the solution and the build!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!