Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error : Could not open Source file: Could not find file 'Web.config;Web.config' #60

Closed
aelij opened this issue May 15, 2023 · 1 comment

Comments

@aelij
Copy link

aelij commented May 15, 2023

This issue is just to log this error in case anyone else encounters it:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\Web\Microsoft.Web.Publishing.targets(1552,5):
error : Could not open Source file: Could not find file 'C:\Project\Web.config;Web.config'. [Project.csproj]

This happened when a project was migrated to SDK-style, while keeping the explicit Content items.

Fix: Add <EnableWebFormsDefaultItems>false</EnableWebFormsDefaultItems> or remove the explicit items.

Thanks for building this package!

@aelij aelij closed this as completed May 15, 2023
@CZEMacLeod
Copy link
Owner

@aelij Thanks for logging this - there is 'special' handling for web.config files, including publishing, transforming and deploying, as well as handling updating binding redirects.
In many cases, you don't need to have the Content or Compile items at all in your project file.
As you say, you can also disable the default includes if you wish to keep the explicit items in the project file (although that loses one of the advantages of the sdk style projects).
Otherwise, I hope you are finding this project useful. Please let us know if there are any other issues you find using the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants