|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Mixing languages in one assemblyI have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This class produces an Excel object and manipulates it based on some input I provide. It works fine and has been fully tested. Meanwhile, another programmer was writing a source file named RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file output. He has fully tested his source and it works as we need it. I *thought* that all I would need to do is add his Cs file to my project, recompile, and life would be grand. However, intellisense only shows me the Vb class. So while FormattedOutput.ExcelOutput is valid, FormattedOutput.RTFOutput is not. We've mixed and matched different source files in this Solution before, but never mixed languages in the same assembly. Can this be done? BK wrote:
Show quoteHide quote > I have a .NET project named FormattedOuput with output type set to It can be... It just takes manual intervention (I think VS2005 can> Class Library. In it, I have a source file named ExcelOutput.Vb. This > class produces an Excel object and manipulates it based on some input I > provide. It works fine and has been fully tested. > > Meanwhile, another programmer was writing a source file named > RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file > output. He has fully tested his source and it works as we need it. > > I *thought* that all I would need to do is add his Cs file to my > project, recompile, and life would be grand. However, intellisense > only shows me the Vb class. So while FormattedOutput.ExcelOutput is > valid, FormattedOutput.RTFOutput is not. We've mixed and matched > different source files in this Solution before, but never mixed > languages in the same assembly. Can this be done? handle this - but, I haven't tried it there so I'm not positive). In other words, you will have to compile and link the code using the commandline compiler/linker programs. It would probably be easier to put the C# code in it's own dll and then reference it from your VB project.... -- Tom Shelton [MVP] What I'm seeing from my research, it can be done but it must be done
from command line calls. It's not the end of the world if I can't do it, I'll probably just rewrite my part in C# as an excercise. This other developer and I get along real well here and commonly split things up. He prefers C#, I prefer Vb. Thanks for all the replies! Bill BK wrote:
> What I'm seeing from my research, it can be done but it must be done You can still share your code without duplicating effort... Just write> from command line calls. It's not the end of the world if I can't do > it, I'll probably just rewrite my part in C# as an excercise. This > other developer and I get along real well here and commonly split > things up. He prefers C#, I prefer Vb. Thanks for all the replies! > > Bill them in class libraries/user controls and distribute the dll's. You can have different projects in the same solution that use different languages - the problems arise when you want to use different languages in the same project. -- Tom Shelton [MVP] AFAIK :
- you can't mix languages inside the same project. - if I remember this is a VS.NET limitation. A workaround could be to compile (using the command line compiler) one of the file to a "module" (doesn't have anything to do with vb modules, see this rather as a .LIB file) and then you could be able to compile (wiht the command line compiler) the other file adding the previous "module" I actually tried to find this in the doc and saw : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/valrfTargetmoduleCreateModuleToAddToAssembly.asp Please let us know (never tried, would like to know if it works). -- Patrice "BK" <bkunn***@hotmail.com> a écrit dans le message de news: 1144248890.347697.87***@i40g2000cwc.googlegroups.com...Show quoteHide quote >I have a .NET project named FormattedOuput with output type set to > Class Library. In it, I have a source file named ExcelOutput.Vb. This > class produces an Excel object and manipulates it based on some input I > provide. It works fine and has been fully tested. > > Meanwhile, another programmer was writing a source file named > RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file > output. He has fully tested his source and it works as we need it. > > I *thought* that all I would need to do is add his Cs file to my > project, recompile, and life would be grand. However, intellisense > only shows me the Vb class. So while FormattedOutput.ExcelOutput is > valid, FormattedOutput.RTFOutput is not. We've mixed and matched > different source files in this Solution before, but never mixed > languages in the same assembly. Can this be done? >
Show quote
Hide quote
"BK" <bkunn***@hotmail.com> wrote in message No. One assembly, one language. You will either have to convert to a news:1144248890.347697.87270@i40g2000cwc.googlegroups.com... >I have a .NET project named FormattedOuput with output type set to > Class Library. In it, I have a source file named ExcelOutput.Vb. This > class produces an Excel object and manipulates it based on some input I > provide. It works fine and has been fully tested. > > Meanwhile, another programmer was writing a source file named > RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file > output. He has fully tested his source and it works as we need it. > > I *thought* that all I would need to do is add his Cs file to my > project, recompile, and life would be grand. However, intellisense > only shows me the Vb class. So while FormattedOutput.ExcelOutput is > valid, FormattedOutput.RTFOutput is not. We've mixed and matched > different source files in this Solution before, but never mixed > languages in the same assembly. Can this be done? > single language or create two different projects. Mythran
Show quote
Hide quote
"Mythran" <kip_potter@hotmail.comREMOVETRAIL> wrote in message I stand corrected.news:OAwjkSMWGHA.3848@TK2MSFTNGP05.phx.gbl... > > "BK" <bkunn***@hotmail.com> wrote in message > news:1144248890.347697.87270@i40g2000cwc.googlegroups.com... >>I have a .NET project named FormattedOuput with output type set to >> Class Library. In it, I have a source file named ExcelOutput.Vb. This >> class produces an Excel object and manipulates it based on some input I >> provide. It works fine and has been fully tested. >> >> Meanwhile, another programmer was writing a source file named >> RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file >> output. He has fully tested his source and it works as we need it. >> >> I *thought* that all I would need to do is add his Cs file to my >> project, recompile, and life would be grand. However, intellisense >> only shows me the Vb class. So while FormattedOutput.ExcelOutput is >> valid, FormattedOutput.RTFOutput is not. We've mixed and matched >> different source files in this Solution before, but never mixed >> languages in the same assembly. Can this be done? >> > > No. One assembly, one language. You will either have to convert to a > single language or create two different projects. > > Mythran > Mythran Not using the VS IDE, you need to do it by hand using the SDK command-line
compilers / linkers. You can only mix languages in the same project using the IDE when doing VS 2005 web projects. -- Show quoteHide quoteBest regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio You can code, design and document much faster: http://www.mztools.com "BK" <bkunn***@hotmail.com> escribió en el mensaje news:1144248890.347697.87270@i40g2000cwc.googlegroups.com... >I have a .NET project named FormattedOuput with output type set to > Class Library. In it, I have a source file named ExcelOutput.Vb. This > class produces an Excel object and manipulates it based on some input I > provide. It works fine and has been fully tested. > > Meanwhile, another programmer was writing a source file named > RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file > output. He has fully tested his source and it works as we need it. > > I *thought* that all I would need to do is add his Cs file to my > project, recompile, and life would be grand. However, intellisense > only shows me the Vb class. So while FormattedOutput.ExcelOutput is > valid, FormattedOutput.RTFOutput is not. We've mixed and matched > different source files in this Solution before, but never mixed > languages in the same assembly. Can this be done? >
Try catch and Resume
Adobe acrobat doesn't close my files? Installer Project - Conditions on Custom Action How to "append" a datatable? Running program in VB.NET doesn't work? Creating a Help System Read-only collection... Content of Datagridview to Excel Regular expression help... One line of code not working : susposed to resize datagrid column.. |
|||||||||||||||||||||||