In my web application we are using HTTP modules, this module has been registered as follows:
<system.webServer>
<modules>
<add name="MyModule" type="com.Security.MyModule, MyModule, version=1.0.5873.52018, culture= neutral, PublicKeyToken=fegg50b0f0f4" preCondition="managedHandler" />
<modules>
<system.webServer>
I want to edit the functionality of this module, where can I find the physical path of the above module.
Note: There is no assembly reference made for this module in the web application. The above Registration code in the Web.config file is the only link between the module and application.
I would search in the local directory, the bin and in the GAC. More information on assembly loading can be found here.... You may also like to try Fuslogvw.
Related
I have setup ASP project but when I am opening my local url in browser I am getting below error:
Parser Error Message: Could not load file or assembly
'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0,
Culture=neutral, PublicKeyToken=0545b0627da60a5f' or one of its
dependencies. The system cannot find the file specified.
Line 16: <compilation debug="true" targetFramework="4.6.2" defaultLanguage="c#">
Line 17: <assemblies>
Line 18: <add assembly="Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545B0627DA60A5F" />
Line 19: </assemblies>
Line 20: </compilation>
Had the same problem using a DB provider. Fixed it by installing the URL Rewrite extensibility code samples.
During the installation make sure to select the "Runtime" option in the custom setup. This will register the sample providers in .NET Global Assembly Cache so that they can be used by URL Rewrite Module.
Using Custom Rewrite Providers with URL Rewrite Module
You error message indicates that the DLL is missing. Have you installed the IIS URL Rewrite Module?
For more another possible solution you can look at this post.
Been looking around but cannot find an answer. I wrote an asmx on VS2012 locally works good. Now deploying to the remote target site it is becoming an issue. On that site there are other asmx services and in their global web.config they have this section
...
<system.webServer>
...
<handlers>
...
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123456789" />
...
</handlers>
...
</system.webServer>
I placed my asmx on a subfolder defining an Application on IIS8 and I'm trying to overwrite that global setting with my local web.config, tried different permutations on the local web.config with location to avoid inheritance but so far it always gives me the lovely
Server error in '/my_svc' Application
CS0246: The type or namespace name 'ForeignNS' could not be found
Is it possible to override it by only changing my local web.config? If so how? If at all possible? Target site admin will not allow to change global web.config unless it is absolutely necessary.
I am part of a team working on a large application. I am a new addition to this team and am building a new piece of the app. As part of this process, I've created a WebApi application that will expose some HTTP endpoints through which I will retrieve information about the app.
Due to conditions it would take far too long to explain, I'd like to get the WebApi project to build in another directory, specifically ..\bin\Server\Debug\ as this is where most of the other portions of the app build to. I would not bother except that the app tried to use files that are found based on the working directory which is currently wrong for my WebApi app.
I tried changing it in the project settings and now I get this error:
My Googling has turned up little help thus far. Anyone know how to resolve this?
Try adding a runtime probing path in the configuration:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin\server\Debug;"/>
</assemblyBinding>
</runtime>
</configuration>
In addition to above step and to get rid of globa.asax error. Open the mark up of Global.asax file and Add follow line on the top.
<%# Assembly Name="<you_web_app_assembly_name_here>" %>
Now you'll start getting the error of System.web or BindingProvider not found etc. There's weird fix for it start adding assemblies to assembly tag under compilation.
<compilation debug="true" targetFramework="4.5" optimizeCompilations="false">
<assemblies>
<add assembly="Microsoft.AspNet.Identity.Core, Version=2.2.1, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
You'll get few more errors like this but this will get you going.
Reason: The problem I see is that there's an option to change the output path but Asp.net does on the fly compilation. Which why the error are compilation related when you try to run the website. Somewhere the run time compilation only look in \bin folder and which is why we have to specify every assembly that the project is referencing to.
Update -
Unfortunately you can not change the bin directory. After looking at all options and digging found that bin folder of Asp.net web project is not ordinary binary output folder. It's a share code folder from where the binaries are referenced directly in the project.
The binaries are compiled when a first request is received by webserver for Asp.net application. And bin folder is only use as shared binary references folder and not the actual output folder/directory.
The actual output folder of On-the-fly compilation in Asp.net is default set to %SystemRoot%\Microsoft.NET\Framework\<versionNumber>\Temporary ASP.NET Files that you can change ofcourse from compilation tag attribute [tempDirectory][3] in your web.config.
After all these research I came to this conclusion that the option for changing the directory from project -> properties -> Build -> Bin is appearing because of Asp.net website project template. This gives the user same look'n feel as any other project. But the functionality of asp.net website remains the same. The Bin folder still works as it used to work in old website template of Asp.net.
You cannot change the output directory of an asp.net application due to IIS security restrictions, this is why it is not working.
If you are trying to manage dlls due to DI, copy all other satellite dlls into bin folder of your main asp.net app
You can try copying the dll with the after build target. First change the output path back to what it was if you changed it before. Then add some code like this in your project file.
<target name="AfterBuild">
<copy destinationfolder="..\bin\Server\Debug\" overwritereadonlyfiles="true" sourcefiles="$(OutputPath)\$(AssemblyName).dll" />
<copy destinationfolder="..\bin\Server\Debug\" overwritereadonlyfiles="true" sourcefiles="$(OutputPath)\$(AssemblyName).pdb" />
<copy destinationfolder="..\bin\Server\Debug\" overwritereadonlyfiles="true" sourcefiles="$(OutputPath)\$(AssemblyName).xml" />
</target>
This will put the built dll in to the folder specified in destinationfolder. I usually use this for class libraries but i don't see why it would not work for a web api project
You can check out my blog post on this if you like.
http://torontoprogrammers.blogspot.com/2014/11/msbuild-targets-and-tasks.html
I'm having an issue where I keep getting error message CS0246 on my web server, but not in my visual studio environment. The issue is coming from a dll I reference in my project. The server cannot find my namespace for my dll.
To solve this I tried copying every file in my project directory to my web server, adding a tag in my web.config file, and adding an import statement in my aspx page. I have also tried adding an assembly reference in my aspx page, but that seems to require a change in the registry which I don't think I have access to.
I should also note my dll and namespace name are different, but changing the names of either did nothing. I also completely removed the dll and copied the code files directly into my project, but it still could not find the namespace.
I thus think I'm supposed to register the namespace and dll somewhere else, but I cannot figure out where. Any help will be appreciated.
If it matters, both my web project and dll are using .NET2.0
I know this is the equivalent of the annoying "did you reboot", but have you tried making a new solution and re-adding the projects and references? Sometimes the .sln file can get corrupted.
Sometimes, the web.config file contains instructions for the .NET framework to generate temporary files.
Please check your config file for something similar to:
<system.web.webPages.razor>
<host
factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="YourNamespace.ShouldBeCorrect.Here" />
</namespaces>
</pages>
</system.web.webPages.razor>
This is likely the case if your error page contains a reference to a dynamically generated file such as:
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\133f2363\4ba6d0ba\App_Web_index.cshtml.a8d08dba.ociepbng.0.cs Line: 27
I've registered a control in my web.config file and the .dll for the control has been placed in the application's Bin folder.
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="RichTextEditor"/>
</assemblies>
</compilation>
<pages>
<controls>
<add assembly="RichTextEditor" namespace="RichTextEditor" tagPrefix="cc1" />
</controls>
</pages>
I can now use this control in .aspx pages in the application root folder without issue. However, some of the .aspx pages I want to use this control in are stored in a sub-folder of the application (In this case a sub-folder called "Admin"). When I try to use these controls in these pages and run in debug I get an error of:
Error 1 Unknown server tag 'cc1:RichTextEditor'. N:\IntranetV2\admin\EditMenuItem.aspx 27
I'm sure I'm missing something simple here but I can't seem to figure out how to get this working and googling doesn't seem to have helped much.
UPDATE:
Okay I've tried Aaron's solution with no luck, I amended his code suggestion to:
<add tagPrefix="cc1" tagName="RichTextEditor" src="~/Bin/RichTextEditor.dll" />
I hoped this would be all that's required however I now get the error:
Error 1 There is no build provider registered for the extension '.dll'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.
Please can someone help! I know the answer to this must be ridiculously simple but I'm going mad trying to fix it myself and google has proved no help.
I had some similar problems a while back. Only way I was able to get the control working was something like this:
<add tagPrefix="cc1" tagName="RichTextEditor" src="~/controls/richtexteditor.ascx">
rather than this:
<add assembly="RichTextEditor" namespace="RichTextEditor" tagPrefix="cc1" />
EDIT:
Since you're using a binary, add the .dll to your solution, and add a reference to it in the project where you're using it. This way, .NET will add the .dll to your bin folder. Then, go back to this (and verify that the namespace and assembly are correct):
<add assembly="RichTextEditor" namespace="RichTextEditor" tagPrefix="cc1" />
Also, check this out as a reference: Tip/Trick: How to Register User Controls and Custom Controls in Web.config
Is the folder defined as an application in IIS? That would cause such a problem since in that case IIS will look for web.config (as well as bin/ and other special files and folders) inside that subfolder.