the type exists in both asp.net - blogengine.net

I just integreated blogengine.net into my exting webapplication(not a website)
To do this I have converted all blog engine pages into webapplication page. set namespace references according to the application folders
I have built solution successfully.But when I run main application following error occured.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'MyStore.App_Code.Controls.PostPager' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6332283b\32bb0d6a\App_Code.afjt0bia.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6332283b\32bb0d6a\assembly\dl3\faca6d87\a3e83425_6ad8cd01\MyStore.DLL'
I have checked all the namespace refferences but I haven't found any duplicate refferences.
please help me to get out of this.

Move your code files out of the App_Code folder and put them in a Classes folder.

Related

reset password MVC core 2.1 template with identity scaffold cannot find _Layoutlogin .cshtml

I am getting an error with my asp.net core 2.1 MVC project template. It looks like _Layoutlogin .cshtml is not able find. File is there in the shared folder and the only thing is that in the error message before .chmtl there is space at the end. This is happening after scaffolding idenitity
An unhandled exception occurred while processing the request.
InvalidOperationException: The layout view '~/Views/Shared/_Layoutlogin .cshtml' could not be located. The following locations were searched:
~/Views/Shared/_Layoutlogin .cshtml
Microsoft.AspNetCore.Mvc.Razor.RazorView.GetLayoutPage(ViewContext context, string executingFilePath, string layoutPath)
I suspect you have a typo some place if you check _Layoutlogin .cshtml there is a space in their so if in fact your file is _Layoutlogin.cshtml its not going to find it.

Unable to load DLL 'libuv': The specified module could not be found

When I open new project of type asp.net mvc .net core web application and I try to run it, chrome is opend but nothing is showing.
When I put try catch on the code in (progran.cs), I get error :-
Count = error CS0103: The name 'InnerExceptionCount' does not exist in
the current context One or more errors occurred. (Unable to load
DLL 'libuv': The specified module could not be found. (Exception from
HRESULT: 0x8007007E))

Appharbor build error

On attempting to build an MVC application on appharbor I'm consistently getting the following error -
AfterBuild:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v
temp -p D:\temp\yjartxut.xdg\output_PublishedWebsites\groundstour
ASPNETCOMPILER : error ASPRUNTIME: The current identity
(IP-0A7AA6EA\apphb3308801b5493433) does not have write access to
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files'.
I've searched the appharbor support forums but can't find a thread that deals with an error similar to the one above, could anyone shed any light on the error or what I could do to fix it?
This was an AppHarbor-problem, and it should now be resolved.
(disclaimer, I'm co-founder of AppHarbor)

Stuck with ASPNETCOMPILER : error ASPRUNTIME: Type is not resolved for member 'FluentNHibernate.Cfg.FluentConfigurationException,FluentNHibernate

I'm using Team City for continual integration, for a .Net 4 ASP MVC 3 application.
On my dev machine I can build and run my application, but on the build sever I'm getting the following error:
ASPNETCOMPILER : error ASPRUNTIME: Type is not resolved for member 'FluentNHibernate.Cfg.FluentConfigurationException,FluentNHibernate, Version=1.2.0.712, Culture=neutral, PublicKeyToken=8aa435e3cb308880'
The FluentNHibernate assembly is referenced by the project and I've even added the assembly to the web.config assemblies section, but I still get the error.
What can I do to diagnose the problem?
To sum up Rob White's comment, the problem is certain code running in WebActivator.PreApplicationStartMethod. The fix is to move that code into Application_Start in the Global.asax.
The WebActivator.PreApplicationStartMethod is an assembly attribute for loading code extremely early in the build process. Phil Haack give a good description. The attribute is supposed to be used for registering build providers and other things that are used later in the build process. As such, the ASPNET compiler has to load and run this code in order to begin compilation of views.
I got this particular error on appharbor after I added some code to my IoC (StructureMap) startup code that accessed a resource (MongoDB). Since this resource wasn't accessible to the appharbor build machine, it threw all kinds of errors.
The takeaway is that PreApplicationStartMethod is meant for pre-application-start things, like building, not initializing the application. If you're doing app initialization things, do it in Global.asax Application_Start. I know the default StructureMap NuGet package for MVC4 uses the attribute instead of Global. There might be other packages that lead you to that same mistake.

Web Service error 'Could not create type' when calling service from Ajax

I've downloaded the Ajax Control toolkit
When I create a website from the Ajax control Toolkit template, I can create a web service in a single file (asmx) and hook this up to different Ajax controls provided in the toolkit.
However if I add the Toolkit to an existing ASP.Net 2.0 appliction web project I cannot create web services in a single asmx file. If I create a web service VS always creates a code behind file as well. As a result of this calls to the web service (or loading the service directly in the browser) generate the following error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'AddAjaxToApplication.List'.
Source Error:
Line 1: <%# WebService Language="C#" CodeBehind="List.asmx.cs" Class="AddAjaxToApplication.List" %>
Does anyone know how to resolve this?
Thanks,
Tim
I fixed this in the end.
In VS 2005 I just needed to right click on the web service and select "View Markup". I just changed the markup to use the correct namespace:
Line 1: <%# WebService Language="C#" CodeBehind="List.asmx.cs" Class="List" %>
I Just removed the project name from the namespace to match the namespace used by List.asmx and this error went away.
In my instance I had renamed the class something different than the .asmx file, so when referencing the file from the .aspx code it would generate this error.
So I had 'AjaxManager.asmx', but had renamed the class to 'AjaxService', and the markup did not match. In my case, leaving the fully qualified namespace did not cause any issue. So if you change the class name (probably not reccomended anyway), make sure to correct the markup as well as shown below:
<%# WebService Language="vb" CodeBehind="AJAXManager.asmx.vb" Class="MyProject.UI.AjaxService" %>
One more Important Things and simple solution that i found out while creating web service . Try to avoid creating code behind file
I was facing same problem while accessing web service in a virtual directory in iis 7 , then i created inline code asmx file and then access it , it was accessible
I solved the problem by moving the code behind file MyService.asmx.cs to the App_Code directory.
I solved this by ensuring that MyService.dll was deployed in the /bin folder below my Web.config.
Check in the Published folder if the path for the specified class files really exist or not, For me the App_Code folder was not present in the published directory so I manually placed the folder there and it is working perfectly :-)
I solved this by giving the full path of the codebehind like this
CodeBehind="~/codebehind.asmx.cs"

Resources