mark
mark

Reputation: 62876

How to make resource files in the bin folder of an ASP.NET deployed along with the assemblies?

My ASP.NET application depends on a .NET assembly, which in turn expects a certain resource file to be found beside it. I.e. this how it loads this resource file:

var folder = Path.GetDirectoryName(typeof(T).Assembly.Location);
var file = typeof(T).FullName + ".xaml";
var source = Path.Combine(folder, file);
var result = Load(source);

As you can see, it expects a certain xaml file near it.

In the ASP.NET csproj file, there is no reference to the .NET assembly, it is simply found in the bin folder.

When I run the ASP.NET application, the .NET assembly is copied from the ASP.NET project bin folder somewhere under Temporary ASP.NET Files, but only the DLL is copied, the XAML files is left behind.

What should I do to make the XAML file copied as well?

Thanks.

Upvotes: 0

Views: 1444

Answers (1)

Edwin de Koning
Edwin de Koning

Reputation: 14387

You could try this:

Right-click your xaml file, select properties. Then under 'copy to output directory' select either 'copy always' or 'copy if newer'.

Upvotes: 1

Related Questions