[assembly:TagPrefix("", "")] Problems

S

Seraph

I've never posted here before, but I have lurked for quite some time,
and have been frustrated to my whits end on what to do about this.
Since there is limited support in previous posts (and many of them
being outdated by years at a time) I've decided to post my findings so
that hopefully someone else might benefit from my frustration.

If you've stumbled upon this post, you most likely already know, in
theory, how to define your own custom tagprefix using the assembly
directive:

[assembly:TagPrefix("Namespace", "Prefix")]

And so when you compile and drag and drop your control to your project,
lo and behold: There's still a blasted cc1 in the prefix area.

Here are a few steps to try to alleviate your frustrations.

1. Delete the assembly from your toolbox, _rebuild_ your assembly and
not just build, and add the assembly back again. Try dragging and
dropping.

2. Delete the assembly from your toolbox. Ensure that in the HTML
portion of your page, the <%@ Register> line is gone. Close VS. Open
your assembly. Rebuild your assembly. Close VS. Open your project that
you are trying to add your control to. Add the assembly. Try dragging
and dropping.

3. Create a new project and try dragging and dropping your control onto
the page of the new project.

This last solution is the only thing that has gotten my control to
work. I think there is something extremely fishy in the guts of Visual
Studio that keeps track of an assembly's prefix or something. If
someone has information as to _why_ this is happening, please reply
back soon. This was extremely frustrating for me, and I can only hope
to avoid it in the future.

I think a good rule of thumb for this is: don't add your control to the
toolbox until you have added the assembly directive to your control's
code.

Hopefully this has helped someone else out there, and saved a bit of
frustration for you.

--Seraph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top