none
Library project file cannot specify ApplicationDefinition element.

    Question

  •  Very strange problem....

    I added <asp:Image> tag to my default.aspx page and I got the following errors....now that I deleted the tag....I still get the same error :(

    any iadeas????

    these are errors:

    Library project file cannot specify ApplicationDefinition element.

    The project file contains a property value that is not valid.

     

    here is my Default.aspx page

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="System7Web._Default" %>

    <%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"

    TagPrefix="asp" %>

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title></title>

    </head>

    <body>

    <form id="form1" runat="server">

    <asp:Table>

    <asp:TableHeaderRow>

    <asp:TableHeaderCell>

    header

    </asp:TableHeaderCell>

    </asp:TableHeaderRow>

    <asp:TableRow>

    <asp:TableCell>

    <div>

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/System7.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" />

    </div>

    </asp:TableCell>

    </asp:TableRow>

    <asp:TableFooterRow>

    <asp:TableCell>

    footer

    </asp:TableCell>

    </asp:TableFooterRow>

    </asp:Table>

     

     

    </form>

    </body>

    </html>

    I need just to replace header and footer with image...how can I do that? and how can I get rid of these two error messages????

     Thanks so much
    MT

    Friday, September 26, 2008 4:44 PM

Answers

  • I found why the problem is happening.....my big mistake....

    This was just result of copy and pasting iamges folder through the program....wrong wrong thing to do....I had to create the images folder directly under my asp project and then add the images into it....not copy from Silverlight project and pasting it under the asp project....that was causing the library issue error....

    Once I deleted the folder and created a new folder...it worked....

    Thanks for your replies :)
    MT

    Monday, September 29, 2008 2:36 PM

All replies

  • How did you add the <asp:Image> tag? Like this? <asp:Image ImageUrl="YourImageURL" runat="server" />

    By the way, do you really need to add those tags as Server control? You can use html tag <image src="YourImageURL" />. Same as those <asp:Table/><asp:TableRow/><asp:TableCell/> tags. Why not just use <Table> <TR><TD>.

    Unless you need code behind to do something with those server controls. But I did not see any ID is assigned on those server controls,  that means you do not even intend to refer them in your code behind.

    The server control will render the same HTML tag to your page. If you do not want to do anything with those tag in your code, write out those HTML tag yourself is more efficient. You do not need server processing time at all.

     

     

     

     

     

     

    Friday, September 26, 2008 5:08 PM
  • You are right, I don't need them right now and It's better to use just html code....but for some reason it didn't work that's why I tried <asp:table> control and it worked....

    but now I can't get it to work at all....although I deleted the code <asp:Image> tag....

    I tried <img> html tag before and that didn't work....

    I keep getting these two errors and they are not going away from my project....

    I even deleted my Default.aspx page and I placed a new one...but still same errors...complaining about Library!

    errors are:

    Library project file cannot specify ApplicationDefinition element.
    The project file contains a property value that is not valid.

     

    Friday, September 26, 2008 5:22 PM
  • Is the Error come from your aspx page (server side error) or it's from your Silverlight control (client side error)?

    Make sure to isolate the problem. Take the silverlight control out first to test your aspx page, if no error, then it's caused by Silverlight control. Otherwise, it has nothing to do with Silverlight, something wrong with your aspx page.

     

     

     

     

    Friday, September 26, 2008 5:29 PM
  • This is not Silverlight error at all....I didn't make any changes to the project....

    The only change I made adding the tag and boom I got the error...I removed the tag and still the error is there....

    I use WCF in my program, so the Silverlight and ASPX pages are working together....I can't just build one of them...or...I don't know how to do that...they work together....

    but the error is on the server side, the aspx page....

    It is really frustrating...as I got this error yesterday too...

    It looks like by using <asp:Image> tag, some changes had happend into the Class Library....and I can't get rid of the change by just deleting the tag....

    do you know how I can access to the Class Library?

    thanks
    MT

    Friday, September 26, 2008 6:10 PM
  • What class library? The .Net class library? How can you affect the class library by using a <asp:Image> tag? Are you running your page on IIS or the Dev server? 

    If you think the aspnet get corrupted, use Start/Run to run the following command:

     %Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

     

    Friday, September 26, 2008 9:40 PM
  • Thanks Sladapter....but it's still not working :(

    I don't know which class library....I just keep getting the same error....

    I tried to create the same scenario with a brand new project; but I couldn't get the error....

    I will explain more about the project.

    I have two projects, one is System7(which is silverlight pages) and the other one is System7Web (which is asp pages)...then I have my Web Service to communicate the data between Silverlight, sql and asp pages....The problem happend when I added the <asp:Image ImageUrl="someUrl" runat="server" /> to the default.aspx page....then I removed this tag...but still getting the error....

    This is really strange....but it happened before...and then I had to start the project over from scratch....and in the new project, again the same thing....when I added the <asp:Image> tag, the problem happened and it doesn't go away :(

    I want to kow what is causing this problem....and the problem is on the asp pages...not the Silverlight....

    Thanks again
    Marjan

     

     

    Monday, September 29, 2008 11:58 AM
  •  Then I have no idea what is going on. Discard that aspx page. Just start from a new asxp page and try it. If still not work, start a new Web project and try it.

    Monday, September 29, 2008 12:50 PM
  • I found why the problem is happening.....my big mistake....

    This was just result of copy and pasting iamges folder through the program....wrong wrong thing to do....I had to create the images folder directly under my asp project and then add the images into it....not copy from Silverlight project and pasting it under the asp project....that was causing the library issue error....

    Once I deleted the folder and created a new folder...it worked....

    Thanks for your replies :)
    MT

    Monday, September 29, 2008 2:36 PM
  • Yup, same thing happened to me when copying(not cut, but copy) a png from an /images folder in the Silverlight project into the ClientBin of the web app. I had to delete the png from the ClientBin, then it built fine. Did another copy, and a build was fine after that. Seems like a bug perhaps, sometimes the project files get mucked up on copying binaries or something from Silverlight to a web app.

    Thursday, February 26, 2009 4:55 PM
  •  Super, thx for the info.

     

    Did exactly the same, copy images with folder and put the asp:image tag.

    Deleted the images and added them correctly, now running fine

    Friday, June 25, 2010 6:00 AM
  • FYI: I had the same problem and my mistake was that I by accident had dragged and dropped some files to the web project without knowing. I removed the XAML file and code behind that i had dropped and it worked again.

    Tuesday, August 17, 2010 1:47 PM
  • omg. okay, I just had a complete build failure related to this.  thank you! for posting the answer.  of course, now my brain is on fire trying to figure out why...

    Thursday, August 04, 2011 2:23 PM
  • If you copy images from a Silverlight project to a Web project you must change all image Build Action to Content.

    Friday, September 16, 2011 11:22 AM
  • Wow I just did this and found your post.  Thank you.  I was getting ready to melt down the internet.

    Saturday, March 17, 2012 3:30 PM