1

Error BC2008 no input sources specified

I have same problem as in this question:

"No input sources specified"

Except I'm upgrading from VS2013 to VS2019. It seems that it is no longer possible to have a VB class library project containing no Vb Source code files. The accepted answer seems like a bit of a hack (just include a dummy source code file for it to play with).

I am sure there must be a better solution. Perhaps some way to amend the project file so that I can include 'content' files but without actually having anything that needs compiling?

Any suggestions appreciated.

Phil Preen
  • 589
  • 5
  • 20
  • 1
    Works fine when I try it. There's always at least one source file, AssemblyInfo.vb. It sets the resulting assembly properties, like the version number. How you avoided it is hard to guess when you don't show us anything. – Hans Passant Apr 03 '23 at 14:56
  • 1
    I don't think this project has AssemblyInfo.vb. Not sure if it did once and was deleted or never had it. This is a very old project cretaed many years ago. It is a class library project but there are no vb files so no dll is produced. It is just a whole series of content files in various folders, used as a way to organise the output from various other projects in the solution. I could try creating a new project to replace it, but I was hoping someone could suggest a simple edit to the project file tprevent it from thinking it has to have something to compile. – Phil Preen Apr 03 '23 at 18:03
  • 1
    I tried adding a new 'Empty Project' but I get the same error. – Phil Preen Apr 03 '23 at 18:11
  • 1
    Project > Properties > Application tab > Assembly Information button > give it at least a title. – Hans Passant Apr 03 '23 at 21:14
  • 1
    I'm using VS2019 not 2022. The project has been working for years in VS2013. I assume sometime between those two version, as a change was made in msbuild or in the project file structure to require at least one source code file. So I need another type of project, or a way to edit the project file to create a project that can contain only content files. – Phil Preen Apr 04 '23 at 10:06
  • 1
    @Hans Passant - thanks, that seems to have done the trick. Although interestingly, if I try that in the new empty project that I created as a test, I now get a different error saying that Sub Main cannot be found (I have startup object set to none). It seems to be working for my existing project though. I'm still getting other errors which I'll need to work through but looks like I'm past that one. – Phil Preen Apr 04 '23 at 10:15
  • 1
    Ah, that was because the Application Type was set to Forms application rather than class library. – Phil Preen Apr 04 '23 at 10:18
  • 1
    @hans-passant if you want to add this as an answer I'll accept it. – Phil Preen Apr 04 '23 at 10:24
  • @PhilPreen Hi Phil, I notice the latest answer of Hans was four years ago, if Hans doesn't have time to post an answer, you can post an answer with detailed steps to solve this issue, and accept yourself answer. This will be helpful for others who meet a similar issue and searching it in SO. :) – Bowman Zhu-MSFT Apr 06 '23 at 09:32
  • 1
    Yes. I'll do that. I just wanted to give them time to take the credit first. – Phil Preen Apr 07 '23 at 10:42

1 Answers1

1

This can be fixed by adding a title in the application settings for the project. This creates the AssemblyInfo.Vb file which seems to be enough to get rid of the error but doesn't cause a dll to be produced.

I still think there might be a better solution using a different type of project file that allows 'content files' organised into folders but that doesn't expect to have to compile any code. So if anyone knows how to do that please add it as an answer.

Phil Preen
  • 589
  • 5
  • 20
  • Hi Phil, you can [accept this as the answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235), this will help others when they search for the similar issue in stackoverflow. For giving credit to others, you can mark another solution you think is better when others post it. :) – Bowman Zhu-MSFT Apr 21 '23 at 09:38