VS2005: How not to have VS try to parse resources of text files as html?

I included the resource in my Visual Studio 2005 solution, which was a file on my hard drive. It is a text file containing text and has a .htm extension .

It worked fine for several months until I wanted to edit the contents of the text file. All of a sudden, Visual Studio insists on the file validation syntax as if it were an HTML file - when it isn't.

I would hate to work around this error in Visual Studio by forcing the file to be called:

SomeFilename.htm.VSbug.doNotRemove

      

but not

SomeFilename.htm

      

Not everyone using the file is Visual Studio and it would be a shame to get everyone to change due to issues with Visual Studio.

More importantly, what I originally did to get VS to (correctly) ignore accidentally added text files - and how do I do that again?


Update one

Since some people are of course curious - here is the content of the file:

SomeFilename.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"> 
<HTML>
<HEAD>
    <TITLE>New Document</TITLE>
    <META http-equiv="X-UA-Compatible" content="IE=edge">
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
</HEAD>

<BODY style="margin: 0 auto">
    <DIV style="text-align:center;">
        <A href="%PANELLINK%" target="_blank"><IMG border="0" src="%PANELIMAGE%" style="%IMAGESTYLE%"></A><BR>
        %CAPTIONTEXT%
    </DIV>
</BODY>
</HTML>

      

As you can see, the file does not contain html. Don't forget - the content of the file is near the point.


Answer

Editing the file through Visual Studio is what makes Visual Studio think it has some sort of jurisdiction over the content of the resource file.

Deleting the file and re-adding it, as well as editing the resource text file outside of VS, ensures that VS doesn't try to parse the file's contents.

0


source to share


2 answers


This obviously begs the question: why are you using the wrong file extension on a system where the file type is determined by those extensions?

Sorry, the answer is of course wrong. I was sure I had already done this. However, I think the above comment is still valid even if it is not universally applicable. Marking the answer as "offensive" is just rude and doesn't change that.



However, your problem can be solved relatively easily. Instead of double-clicking a file, you can right-click it and select "Open With ..." from its context menu. There you can choose a text editor.

+1


source


Perhaps it?

http://weblogs.asp.net/scottgu/archive/2007/09/18/vs-2008-support-to-treat-html-css-and-jscript-validation-issues-as-warnings-instead-of- errors.aspx



I opened my 2005 and went to Tools -> options -> text editor -> HTML / XML -> HTML and uncheck "enable HTML validation". I think this should solve your problem.

0


source







All Articles