0

I have a solution, Winforms, mainly composed from VB.NET projects (Wiforms, Constrols and business classes).

How, I added to it a WPF project, but wrote it in C#.

Actually, every time I make a modification in the WPF C# project, I need to (re)build the C#WPF project.

Is there a option to make it work like other (VB.NET) projects (accept and "see" the changes without rebuilding the C# project)?

An example:

When I reference project "R.VB" in project "M.VB", I add a method "DoTest" in the "R.VB" and use that method in "M.VB" without compile errors.

If I add "DoTest" in the C# WPF Control and try to use it in "M.VB" project, I recieve a compile error "DoTest" is not a member od "R.C#Class".

C# options in my VS

enter image description here

2
  • 1
    Even if everything was written in C# you would have to rebuild. Your question makes no sense. Commented Mar 2, 2012 at 15:27
  • 1
    @Ramhound "if everything was written in C# you would have to rebuild", I agree, BUT in VB.NET you don't need to rebuild. Commented Mar 5, 2012 at 10:12

5 Answers 5

1

No, C# does does support background compilation.

Sign up to request clarification or add additional context in comments.

2 Comments

C# does support background compilation, since Visual Studio 2008 SP1. but make sure it is switched on
C#'s background compilation is different to the VB.net one. C# checks the syntax but does not make the changes visible outside the assembly.
0

No- if you change the code you need to re-compile, at least I think that is what you are asking.

1 Comment

When I reference project "R.VB" in project "M.VB", I add a method "DoTest" in the "R.VB" and use that method in "M.VB" without compile errors. If I add "DoTest" in the C# WPF Control and try to use it in "M.VB" project, I recieve a compile error "DoTest" is not a member od "R.C#Class".
0

Do you have both the VB.NET projects and your C#/WPF stuff in the same solution? They should automatically rebuild if you do. If you use an assembly reference, you need to do it by hand. As far as I know, changing the code without rebuilding in VB6-style is not supported in .NET anyway...

1 Comment

When I reference project "R.VB" in project "M.VB", I add a method "DoTest" in the "R.VB" and use that method in "M.VB" without compile errors. If I add "DoTest" in the C# WPF Control and try to use it in "M.VB" project, I recieve a compile error "DoTest" is not a member od "R.C#Class".
0

If project A references project B, A can't see changes in B until project B is rebuilt.

However, if you want autocompletion and a few other tricks before recompiling referenced projects, you could use an extension that looks at your source code instead of your compiled output, such as ReSharper.

3 Comments

I don't know, I know that I need to recompile every time the C# project but any of VB.NET ones, I reference projects, not dll's ...
VB.NET project references may behave differently - I'm a C# dev. When you reference a C# project, you are actually referencing the compiled dll of your selected configuration (Debug/Release/etc).
Exactly, jrummel, you are talking about C# projects, but I say about both of them C#(slave) in a VB(master)this is about VB.NET projects, that does not behave exactly like the C# ones. see my update (example)...
0

if you need dynamic build you can take a look at project Roslyn

more info here

"Developers could also use the output of such software to do tasks like refactor, or reorganize, their code more easily, to add C# and Visual Basic functionality to programs written in other languages. It also adds dynamic typing to the statically typed C# and Visual Basic, allowing developers to add objects and new variables to a program on the fly."

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.