Crazy web.config errors after Publishing site

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/5/2012 8:27:45 PM
Gravatar
Total Posts 23

Crazy web.config errors after Publishing site

Hello,

I'm getting bizzare web.config errors after publishing a mojoPortal site (with custom functionality added) twice using Visual Studio 2010.

2nd time: Published directly to web host subfolder usinjg web deploy.  web.config errror: Parser Error Message: The 'add' start tag on line 22 position 3 does not match the end tag of 'appSettings'. Line 69, position 3.

Line 22 and 69 have nothing to do with start or end appSettings.  Both are just parts of comments, correctly coded.  Opening appSettings tag is on line 32 and close is on line 712!

1st time: Published to a local folder than ftped the folder up to the site.  web.config error: Parser Error Message: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 24, position 3.  Again line 24 is just a comment.

Also, the common denominator here does not appear to be comments...it seems to be the physical line number that the error flags! (second time line 69, 1st time line 24).  If I delete some of the comments, so that the line number that it flags as an error has a normal element on it (not a comment), I still get the same error and same line number!!!  The code appears to be fine.

Also, I don't think there is a missmatched .NET version issue going on.  Locally I developed the site using .NET 4 and I have .NET 4 selected at my web host for all my sites.

The first time I published this site I did not have this problem and it's still running, but the last 2 times I am getting the two errors stated above.

Does anyone have any ideas?  I'm stumped because the code looks ok.

Thanks you,

Dan 

 

8/6/2012 4:28:05 AM
Gravatar
Total Posts 355

Re: Crazy web.config errors after Publishing site

Dan,

Do you have the ability to restart your site via your hosting interface? You may have something in memory that needs to be purged. Also: does your currently functioning site have the same custom feature?

8/6/2012 6:38:02 AM
Gravatar
Total Posts 18439

Re: Crazy web.config errors after Publishing site

You have a typo somewhere in user.config or web.config. probably a funky comment tag or a stray angle bracket somewhere.

Be careful with comments, if you have comment syntax with other comments inside it it will cause errors like this.

ie something like this:

<!-- this is a comment

<!-- and this is a comment -->

more commented stuff -->

will cause an error like this. 

You can't go by the line numbers because when using a user.config file in addition to web.config it throws off the line numbering when the appsettings from user.config are combined with those in web.config, its treated all as one file by the parser so it sees different line numbers than people see when browsing the files.

8/6/2012 10:23:07 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Crazy web.config errors after Publishing site

I've received similar errors when putting two consecutive dashes within a comment in user.config, for example:

<!-- This will throw an error--there are two consecutive dashes in the comment -->

Jamie

8/6/2012 12:46:24 PM
Gravatar
Total Posts 23

Re: Crazy web.config errors after Publishing site

Thank you all for your comments.  Indigo Tea I did restart the domain but didn't help.  And yes currently functioning site has same new feature as the others.  Since this is like finding a needle in a haystack, I just copied the web.config and user.config from functioning site to the others and all are working now!  You're comments really helped!

Thanks again,

Dan

You must sign in to post in the forums. This thread is closed to new posts.