473,796 Members | 2,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code generator output opens in notepad

I found the excellent article by Paulo Reichert at http://blogs.conchango.com/pauloreic...5/21/1459.aspx,
which shows how to build a code generator for Visual Studio 2005. I followed
this and made a small generator that output a dummy file containing only
this:

namespace TestNamespace { public class TestClass { } }

This works nicely. The namespace and class is available in the project and
I can compile it and check that it's present via Reflector.

However, if in the solution explorer I make it show all the files so I can
see my generated file and double-click on that file, it opens up in Notepad,
whereas the Settings.Design er.cs file opens up inside Visual Studio.

Additionally, if I right-click on Settings.Design er.cs and selects View Code,
the file opens up in VS, but if I do the same on mine I get this error message:

---------------------------
Microsoft Visual Studio
---------------------------
There is no editor available for 'D:\Dev\VS.NET\ WindowsApplicat ion113\WindowsA pplication113\t est.Designer.cs '.

Make sure the application for the file type (.cs) is installed.
---------------------------
OK
---------------------------

I'm not sure what, if anything, to do about this.

Opening up both of these files in a binary editor shows me that the Settings.Design er.cs
file got BOM at the start but mine doesn't, probably because I chose UTF-8
encoding.

If anyone got any advice, please let me know. I can post the project if anyone
wants to look at it, but a "short and complete example" can't be shown in
this post.

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vk arlsen.no
PGP KeyID: 0x2A42A1C2
Feb 16 '06 #1
1 3283
> I found the excellent article by Paulo Reichert at
http://blogs.conchango.com/pauloreic...5/21/1459.aspx,
which shows how to build a code generator for Visual Studio 2005. I
followed this and made a small generator that output a dummy file
containing only this:

namespace TestNamespace { public class TestClass { } }

This works nicely. The namespace and class is available in the project
and I can compile it and check that it's present via Reflector.

However, if in the solution explorer I make it show all the files so I
can see my generated file and double-click on that file, it opens up
in Notepad, whereas the Settings.Design er.cs file opens up inside
Visual Studio.


Ok, the answer was simple. I used a MemoryStream internally and had used
..GetBuffer() instead of .ToArray(), which meant that the output, and thus
the file, contained 0-bytes at the end, no doubt throwing off Visual Studio.

I fixed that and now it worked nicely.

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vk arlsen.no
PGP KeyID: 0x2A42A1C2

Feb 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1844
by: Bob | last post by:
I am sure this has been answered in over whelming detail in this group, however the search results have not turned up any thing I am interested in. I want a simple form generator in PHP that accesses a Mysql database. The program should (ideally in my opin): Generate a form when given a database name and table. Options for display only, insert new record, and edit.
16
2485
by: Tran Tuan Anh | last post by:
Dear all: I need your advice on this matter. I am working on a program which takes some pieces of System-C code in and generate some other System-C code. (System-C code is just C++ with some special libraries, hence you can consider it as C++). Right now, the generator program is written in C++. And I feel not so comfortable with C++. I feel C++ is an overkill. Because, I need to generate some code, hence in the program there are a...
11
3542
by: Lues | last post by:
Hi, I'm trying to protect some data in tables with encription (you know why, don't you ;)) I must confess that I'm not very expirienced in writing code, especially encription code. Can any one, please , send VB code for access which I can c/p into one function. It don't have to be RSA, it can be anything which is easy to
6
5517
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp; DataBinder.Eval(Container.DataItem,"StoreEmail") &amp; "&amp;Subject=" &amp; DataBinder.Eval(Container.DataItem,"ProductName") ....
3
2066
by: joshblair | last post by:
Hello, Has anyone ever seen or created such a code generator? I'm looking for a sample of a code generator that will generate code (preferably one that uses C# and the XMLTextWriter) to create an XML document structure based on an XML file as input. I have to build some classes that allow me to generate some very complex/large/nasty XML documents for use in B2B exchange of data (like
4
13391
by: ed | last post by:
Hi all, I'm very new to vb (2nd day) and I need to create a small app that will replace my old batch file with a flashy gui. I had some experience with access 2.0 which helps ;) What I would like is to get the output of the batch file to display on the gui as the batch file is running. if some of you understand unix... I want this: tail -f /var/log/messages
10
54981
by: linhardt | last post by:
I am wondering how to make ASP.NET output XML instead of HTML. Here is my situation: I am using IE as a front-end to browse company documents. Let's say, a user wants a Word document called foobar, then they'd do a http request for "getdoc.aspx?foobar" Now what getdoc.aspx does is it gets the Word document from the server file system, does an XSLT transform on it to hyperlink it to other
3
1800
by: Sander Tekelenburg | last post by:
Situation: I store news articles as individual PHP files. Each file contains HTML and now and then some embedded PHP snippets. Serving those news articles on the Web works fine, through include(). But I want to also serve them through RSS, and found that in that case the PHP source code is served -- it's not being evaluated. So it seems obvious that I need to first evaluate those PHP snippets, store the result in a variable, and use...
1
1580
by: jjmontreal | last post by:
I am trying to run this code in a form when a user double clicks in a particular field. I am unsure how I should do it since it uses 2 text files, one to generate and the other to store to eleminate redundancy. If you can help this newbie, thanks. '========================================================================== ' ' NAME: RandomPasswordGenerator.vbs ' ' AUTHOR: Mark D. MacLachlan , The Spider's Parlor ' URL:...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.