質問

I had to change my .NET 3.5 web site to a web project, so I needed to remove the App_Code folder but found that I still have these:

<%@ Register Assembly="App_Code" Namespace="MyNamespace" TagPrefix="pf" %>

What's the simplest way to get rid of this? I tried renaming the assembly to the projectName.dll but that crashes.

Any ideas?

役に立ちましたか?

解決

You might use this:

<%@ Register Assembly="YourAssemblyName" Namespace="YourNewNamespace" TagPrefix="pf" %>

Regarding a Web Application Microsoft says:

All code-behind class files and stand-alone class files in the project are compiled into a single assembly, which is placed in the Bin folder. Because this is a single assembly, you can specify attributes such as assembly name and version, as well as the location of the output assembly.

So now you should have a unique assembly.

他のヒント

The original idea behind app_code was that code could be dropped in at any time and consumed by the web application. This is a problem because it doesn't really show up in a normal project. So to convert you need to take the code found in app_code and convert into one or more class libraries and include in your web project. when this build's correctly, change the register assembly tags to point at the new .dll file(s).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top