每当我执行此命令时,它会抛出错误MSB3073,代码为9009
$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg DatoCheckerWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)
Run Code Online (Sandbox Code Playgroud)
整个构建文件在这里:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebSiteSource>..\DatoCheckerMvc\</WebSiteSource>
<SetupF>..\Setup\</SetupF>
<PublishF>publish\</PublishF>
<Publish>$(SetupF)$(PublishF)</Publish>
<WebSiteContentCode>WebSiteContent.wxs</WebSiteContentCode>
</PropertyGroup>
<!-- Defining group of temporary files which is the content of the web site. -->
<ItemGroup>
<WebSiteContent Include="$(WebSiteContentCode)" />
</ItemGroup>
<!-- The list of WIX input files -->
<ItemGroup>
<WixCode Include="Product.wxs" />
<WixCode Include="$(WebSiteContentCode)" />
</ItemGroup>
<Target Name="Build">
<!-- Compile whole solution in release mode -->
<MSBuild
Projects="..\DatoCheckerMvc.sln"
Targets="ReBuild"
Properties="Configuration=Release" …Run Code Online (Sandbox Code Playgroud) 我确实有一些无法序列化的代码。我试图在if语句中插入CanRead()和CanWrite(),这表明它们没有读写权限。我也尝试将'java.io.File.setReadable'和'java.io.File.setWriteable'插入为true,但仍然会引发错误。
代码如下:
public static void save(Object obj, String filename) throws FileNotFoundException, IOException
{
File f = new File("c:/DatoChecker/" + filename);
File dir = new File("c:/DatoChecker");
if(!dir.exists())
dir.mkdirs();
f.setReadable(true);
f.setWritable(true);
if(!f.exists())
{
f.createNewFile();
}
FileOutputStream op = null;
ObjectOutputStream objectStream = null;
op = new FileOutputStream(f);
objectStream = new ObjectOutputStream(op);
objectStream.writeObject(obj);
objectStream.close();
}
public static Object fetch(String filename) throws FileNotFoundException, IOException, ClassNotFoundException
{
File f = new File("c:/DatoChecker" + filename);
File dir = new File("c:/DatoChecker");
if(!dir.exists())
dir.mkdirs();
f.setReadable(true);
f.setWritable(true);
if(!f.exists())
{ …Run Code Online (Sandbox Code Playgroud) 我有这个if语句,当我用JOptionPane.showMessageDialog检查时(如代码顶部所示)返回false,但块仍然执行.我看不出我应该做些什么不同.
变量:
码:
JOptionPane.showMessageDialog(null, c.after((Date) h[counter].get(s)));
if(c.after((Date) h[counter].get(s))); //this line
{
Calendar today = Calendar.getInstance();
if(today.after((Date) h[counter].get(s)))
{
GoodsList.removeDate(s, (Date) h[counter].get(s));
}
if(!oldGoods1.containsKey(s))
{
oldGoods1.put(s, (Date) h[counter].get(s));
}
else if(!oldGoods2.containsKey(s))
{
oldGoods2.put(s, (Date) h[counter].get(s));
}
else if(!oldGoods3.containsKey(s))
{
oldGoods3.put(s, (Date) h[counter].get(s));
}
}
Run Code Online (Sandbox Code Playgroud)
先谢谢Highace2
java ×2
boolean ×1
calendar ×1
filestream ×1
hashmap ×1
if-statement ×1
ioexception ×1
msbuild ×1
wix ×1